Blame SOURCES/autofs-5.1.3-fix-memory-leak-in-umount_amd_ext_mount.patch

603f99
autofs-5.1.3 - fix memory leak in umount_amd_ext_mount()
603f99
603f99
From: Ian Kent <raven@themaw.net>
603f99
603f99
Free allocated resources before returning success if mount is
603f99
found to be in use by another user.
603f99
603f99
Signed-off-by: Ian Kent <raven@themaw.net>
603f99
---
603f99
 CHANGELOG    |    1 +
603f99
 lib/mounts.c |    4 ++--
603f99
 2 files changed, 3 insertions(+), 2 deletions(-)
603f99
603f99
--- autofs-5.0.7.orig/CHANGELOG
603f99
+++ autofs-5.0.7/CHANGELOG
603f99
@@ -282,6 +282,7 @@
603f99
 - add function ext_mount_inuse().
603f99
 - add function construct_argv().
603f99
 - add amd mount type program mount support.
603f99
+- fix memory leak in umount_amd_ext_mount().
603f99
 
603f99
 25/07/2012 autofs-5.0.7
603f99
 =======================
603f99
--- autofs-5.0.7.orig/lib/mounts.c
603f99
+++ autofs-5.0.7/lib/mounts.c
603f99
@@ -2076,7 +2076,7 @@ int umount_amd_ext_mount(struct autofs_p
603f99
 
603f99
 		if (!ext_mount_remove(&entry->ext_mount, entry->fs)) {
603f99
 			rv =0;
603f99
-			goto out;
603f99
+			goto out_free;
603f99
 		}
603f99
 
603f99
 		rv = spawnv(ap->logopt, prog, (const char * const *) argv);
603f99
@@ -2089,7 +2089,7 @@ int umount_amd_ext_mount(struct autofs_p
603f99
 			      "umounted program mount at %s", entry->fs);
603f99
 			rmdir_path(ap, entry->fs, ap->dev);
603f99
 		}
603f99
-
603f99
+out_free:
603f99
 		free_argv(argc, (const char **) argv);
603f99
 		free(str);
603f99