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

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