Blame SOURCES/autofs-5.1.0-fix-memory-leak-in-get_defaults_entry.patch

4d476f
autofs-5.1.0 - fix memory leak in get_defaults_entry()
4d476f
4d476f
From: Ian Kent <ikent@redhat.com>
4d476f
4d476f
In get_defaults_entry(), if parsing of the expanded defaults string fails
4d476f
the expanded string used for the parse is not freed.
4d476f
---
4d476f
 CHANGELOG           |    1 +
4d476f
 modules/parse_amd.c |    4 +++-
4d476f
 2 files changed, 4 insertions(+), 1 deletion(-)
4d476f
4d476f
--- autofs-5.0.7.orig/CHANGELOG
4d476f
+++ autofs-5.0.7/CHANGELOG
4d476f
@@ -150,6 +150,7 @@
4d476f
 - fix hosts map options check in lookup_amd_instance().
4d476f
 - fix memory leak in create_client().
4d476f
 - fix memory leak in get_exports().
4d476f
+- fix memory leak in get_defaults_entry().
4d476f
 
4d476f
 25/07/2012 autofs-5.0.7
4d476f
 =======================
4d476f
--- autofs-5.0.7.orig/modules/parse_amd.c
4d476f
+++ autofs-5.0.7/modules/parse_amd.c
4d476f
@@ -1797,8 +1797,10 @@ static struct amd_entry *get_defaults_en
4d476f
 		char *expand;
4d476f
 		if (!expand_selectors(ap, defaults, &expand, sv))
4d476f
 			goto out;
4d476f
-		if (amd_parse_list(ap, expand, &dflts, &sv))
4d476f
+		if (amd_parse_list(ap, expand, &dflts, &sv)) {
4d476f
+			free(expand);
4d476f
 			goto out;
4d476f
+		}
4d476f
 		entry = select_default_entry(ap, &dflts, sv);
4d476f
 		if (!entry->map_type) {
4d476f
 			/*