Blame SOURCES/autofs-5.1.7-add-missing-free-in-handle_mounts.patch

beb904
autofs-5.1.7 - add missing free in handle_mounts()
beb904
beb904
From: Ian Kent <raven@themaw.net>
beb904
beb904
Coverity: error[doubleFree]: Memory pointed to by 'root' is freed twice
beb904
beb904
No it's not, but root isn't freed before the fatal call which crashes
beb904
automount so add a free() before the fatal() call.
beb904
beb904
It appears Coverity doesn't recognise pthread_exit() as an exit condition.
beb904
beb904
Signed-off-by: Ian Kent <raven@themaw.net>
beb904
---
beb904
 CHANGELOG          |    1 +
beb904
 daemon/automount.c |    2 ++
beb904
 2 files changed, 3 insertions(+)
beb904
beb904
--- autofs-5.1.4.orig/CHANGELOG
beb904
+++ autofs-5.1.4/CHANGELOG
beb904
@@ -50,6 +50,7 @@
beb904
 - check for offset with no mount location.
beb904
 - remove mounts_mutex.
beb904
 - remove unused variable from get_exports().
beb904
+- add missing free in handle_mounts().
beb904
 
beb904
 xx/xx/2018 autofs-5.1.5
beb904
 - fix flag file permission.
beb904
--- autofs-5.1.4.orig/daemon/automount.c
beb904
+++ autofs-5.1.4/daemon/automount.c
beb904
@@ -1917,6 +1917,8 @@ void *handle_mounts(void *arg)
beb904
 	status = pthread_mutex_lock(&suc->mutex);
beb904
 	if (status) {
beb904
 		logerr("failed to lock startup condition mutex!");
beb904
+		if (root)
beb904
+			free(root);
beb904
 		fatal(status);
beb904
 	}
beb904