Blame SOURCES/autofs-5.1.7-fix-double-free-in-parse_mapent.patch

29d2b9
autofs-5.1.7 - fix double free in parse_mapent()
29d2b9
29d2b9
From: Ian Kent <raven@themaw.net>
29d2b9
29d2b9
Coverity:
29d2b9
in parse_mapent(): double_free: Calling "free" frees pointer "newopt"
29d2b9
		   which has already been freed.
29d2b9
29d2b9
Signed-off-by: Ian Kent <raven@themaw.net>
29d2b9
---
29d2b9
 CHANGELOG           |    1 +
29d2b9
 modules/parse_sun.c |    2 --
29d2b9
 2 files changed, 1 insertion(+), 2 deletions(-)
29d2b9
29d2b9
diff --git a/CHANGELOG b/CHANGELOG
29d2b9
index ff3d88eb..81461978 100644
29d2b9
--- a/CHANGELOG
29d2b9
+++ b/CHANGELOG
29d2b9
@@ -62,6 +62,7 @@
29d2b9
 - fix dead code in mnts_add_mount().
29d2b9
 - fix arg not used in error print.
29d2b9
 - fix missing lock release in mount_subtree().
29d2b9
+- fix double free in parse_mapent().
29d2b9
 
29d2b9
 25/01/2021 autofs-5.1.7
29d2b9
 - make bind mounts propagation slave by default.
29d2b9
diff --git a/modules/parse_sun.c b/modules/parse_sun.c
29d2b9
index 5d15f892..03a63290 100644
29d2b9
--- a/modules/parse_sun.c
29d2b9
+++ b/modules/parse_sun.c
29d2b9
@@ -974,8 +974,6 @@ static int parse_mapent(const char *ent, char *g_options, char **options, char *
29d2b9
 					estr = strerror_r(errno, buf, MAX_ERR_BUF);
29d2b9
 					error(logopt, MODPREFIX
29d2b9
 					      "concat_options: %s", estr);
29d2b9
-					if (newopt)
29d2b9
-						free(newopt);
29d2b9
 					free(myoptions);
29d2b9
 					return 0;
29d2b9
 				}