diff options
author | Ian Kent <raven@themaw.net> | 2021-04-09 12:17:35 +0800 |
---|---|---|
committer | Ian Kent <raven@themaw.net> | 2021-04-12 13:18:14 +0800 |
commit | 857cd1a249f9a9fbe19a541b377df1ef17b6b05f (patch) | |
tree | b56bc6719d532f0d0d65875918a7d2102acc82c3 | |
parent | e248b7bea99226dcdfd42572928a154674cdb8fa (diff) | |
download | autofs-857cd1a249f9a9fbe19a541b377df1ef17b6b05f.tar.gz |
autofs-5.1.7 - fix dead code in mnts_add_mount()
Coverity: dead_error_line: Execution cannot reach this statement: "free(mp);".
Signed-off-by: Ian Kent <raven@themaw.net>
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | lib/mounts.c | 8 |
2 files changed, 3 insertions, 6 deletions
@@ -59,6 +59,7 @@ - fix flags check in umount_multi(). - dont try umount after stat() ENOENT fail. - remove redundant assignment in master_add_amd_mount_section_mounts(). +- fix dead code in mnts_add_mount(). 25/01/2021 autofs-5.1.7 - make bind mounts propagation slave by default. diff --git a/lib/mounts.c b/lib/mounts.c index ef69cec1..018b9c80 100644 --- a/lib/mounts.c +++ b/lib/mounts.c @@ -1205,13 +1205,13 @@ struct mnt_list *mnts_add_mount(struct autofs_point *ap, if (*name == '/') { mp = strdup(name); if (!mp) - goto fail; + return NULL; } else { int len = ap->len + strlen(name) + 2; mp = malloc(len); if (!mp) - goto fail; + return NULL; strcpy(mp, ap->path); strcat(mp, "/"); strcat(mp, name); @@ -1228,10 +1228,6 @@ struct mnt_list *mnts_add_mount(struct autofs_point *ap, free(mp); return this; -fail: - if (mp) - free(mp); - return NULL; } void mnts_remove_mount(const char *mp, unsigned int flags) |