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

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