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

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