Blame SOURCES/autofs-5.1.1-fix-memory-leak-in-nisplus-lookup_reinit.patch

306fa1
autofs-5.1.1 - fix memory leak in nisplus lookup_reinit()
306fa1
306fa1
From: Ian Kent <raven@themaw.net>
306fa1
306fa1
Don't forget to free context on reinit error.
306fa1
306fa1
Signed-off-by: Ian Kent <raven@themaw.net>
306fa1
---
306fa1
 CHANGELOG                |    1 +
306fa1
 modules/lookup_nisplus.c |    4 +++-
306fa1
 2 files changed, 4 insertions(+), 1 deletion(-)
306fa1
306fa1
--- autofs-5.0.7.orig/CHANGELOG
306fa1
+++ autofs-5.0.7/CHANGELOG
306fa1
@@ -198,6 +198,7 @@
306fa1
 - change lookup to use reinit instead of reopen.
306fa1
 - fix unbind sasl external mech.
306fa1
 - fix sasl connection concurrancy problem.
306fa1
+- fix memory leak in nisplus lookup_reinit().
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
--- autofs-5.0.7.orig/modules/lookup_nisplus.c
306fa1
+++ autofs-5.0.7/modules/lookup_nisplus.c
306fa1
@@ -116,8 +116,10 @@ int lookup_reinit(const char *mapfmt,
306fa1
 
306fa1
 	new->parse = ctxt->parse;
306fa1
 	ret = do_init(mapfmt, argc, argv, new, 1);
306fa1
-	if (ret)
306fa1
+	if (ret) {
306fa1
+		free(new);
306fa1
 		return 1;
306fa1
+	}
306fa1
 
306fa1
 	*context = new;
306fa1