Blame SOURCES/autofs-5.1.7-fix-dead-code-in-mnts_add_mount.patch

49b67f
autofs-5.1.7 - fix dead code in mnts_add_mount()
49b67f
49b67f
From: Ian Kent <raven@themaw.net>
49b67f
49b67f
Coverity: dead_error_line: Execution cannot reach this statement: "free(mp);".
49b67f
49b67f
Signed-off-by: Ian Kent <raven@themaw.net>
49b67f
---
49b67f
 CHANGELOG    |    1 +
49b67f
 lib/mounts.c |    8 ++------
49b67f
 2 files changed, 3 insertions(+), 6 deletions(-)
49b67f
49b67f
--- autofs-5.1.4.orig/CHANGELOG
49b67f
+++ autofs-5.1.4/CHANGELOG
49b67f
@@ -59,6 +59,7 @@
49b67f
 - fix flags check in umount_multi().
49b67f
 - dont try umount after stat() ENOENT fail.
49b67f
 - remove redundant assignment in master_add_amd_mount_section_mounts().
49b67f
+- fix dead code in mnts_add_mount().
49b67f
 
49b67f
 xx/xx/2018 autofs-5.1.5
49b67f
 - fix flag file permission.
49b67f
--- autofs-5.1.4.orig/lib/mounts.c
49b67f
+++ autofs-5.1.4/lib/mounts.c
49b67f
@@ -1205,13 +1205,13 @@ struct mnt_list *mnts_add_mount(struct a
49b67f
 	if (*name == '/') {
49b67f
 		mp = strdup(name);
49b67f
 		if (!mp)
49b67f
-			goto fail;
49b67f
+			return NULL;
49b67f
 	} else {
49b67f
 		int len = ap->len + strlen(name) + 2;
49b67f
 
49b67f
 		mp = malloc(len);
49b67f
 		if (!mp)
49b67f
-			goto fail;
49b67f
+			return NULL;
49b67f
 		strcpy(mp, ap->path);
49b67f
 		strcat(mp, "/");
49b67f
 		strcat(mp, name);
49b67f
@@ -1228,10 +1228,6 @@ struct mnt_list *mnts_add_mount(struct a
49b67f
 	free(mp);
49b67f
 
49b67f
 	return this;
49b67f
-fail:
49b67f
-	if (mp)
49b67f
-		free(mp);
49b67f
-	return NULL;
49b67f
 }
49b67f
 
49b67f
 void mnts_remove_mount(const char *mp, unsigned int flags)