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

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