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

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