autofs-5.1.3 - fix memory leak in umount_amd_ext_mount() From: Ian Kent Free allocated resources before returning success if mount is found to be in use by another user. Signed-off-by: Ian Kent --- CHANGELOG | 1 + lib/mounts.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f3cdcd52..8a9fdb1f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -57,6 +57,7 @@ xx/xx/2017 autofs-5.1.4 - add function ext_mount_inuse(). - add function construct_argv(). - add amd mount type program mount support. +- fix memory leak in umount_amd_ext_mount(). 24/05/2017 autofs-5.1.3 ======================= diff --git a/lib/mounts.c b/lib/mounts.c index 8367a50e..6fa304aa 100644 --- a/lib/mounts.c +++ b/lib/mounts.c @@ -2084,7 +2084,7 @@ int umount_amd_ext_mount(struct autofs_point *ap, struct amd_entry *entry) if (!ext_mount_remove(&entry->ext_mount, entry->fs)) { rv =0; - goto out; + goto out_free; } rv = spawnv(ap->logopt, prog, (const char * const *) argv); @@ -2097,7 +2097,7 @@ int umount_amd_ext_mount(struct autofs_point *ap, struct amd_entry *entry) "umounted program mount at %s", entry->fs); rmdir_path(ap, entry->fs, ap->dev); } - +out_free: free_argv(argc, (const char **) argv); free(str);