Blame SOURCES/autofs-5.1.7-fix-possible-memory-leak-in-master_parse.patch

beb904
autofs-5.1.7 - fix possible memory leak in master_parse()
beb904
beb904
From: Ian Kent <raven@themaw.net>
beb904
beb904
Coverity: Overwriting "path" in "path = master_strdup(yyvsp[-1].strtype)"
beb904
	  leaks the storage that "path" points to.
beb904
beb904
Signed-off-by: Ian Kent <raven@themaw.net>
beb904
---
beb904
 CHANGELOG             |    1 +
beb904
 daemon/master_parse.y |    2 ++
beb904
 2 files changed, 3 insertions(+)
beb904
beb904
--- autofs-5.1.4.orig/CHANGELOG
beb904
+++ autofs-5.1.4/CHANGELOG
beb904
@@ -52,6 +52,7 @@
beb904
 - remove unused variable from get_exports().
beb904
 - add missing free in handle_mounts().
beb904
 - remove redundant if check.
beb904
+- fix possible memory leak in master_parse().
beb904
 
beb904
 xx/xx/2018 autofs-5.1.5
beb904
 - fix flag file permission.
beb904
--- autofs-5.1.4.orig/daemon/master_parse.y
beb904
+++ autofs-5.1.4/daemon/master_parse.y
beb904
@@ -155,6 +155,8 @@ file: {
beb904
 line:
beb904
 	| PATH mapspec
beb904
 	{
beb904
+		if (path)
beb904
+			free(path);
beb904
 		path = master_strdup($1);
beb904
 		if (!path) {
beb904
 			local_free_vars();