autofs-5.1.1 - fix memory leak in nisplus lookup_reinit()

From: Ian Kent <raven@themaw.net>

Don't forget to free context on reinit error.

Signed-off-by: Ian Kent <raven@themaw.net>
---
 CHANGELOG                |    1 +
 modules/lookup_nisplus.c |    4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 663b867..bb2ea30 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -33,6 +33,7 @@
 - remove unused function elapsed().
 - fix unbind sasl external mech.
 - fix sasl connection concurrancy problem.
+- fix memory leak in nisplus lookup_reinit().
 
 21/04/2015 autofs-5.1.1
 =======================
diff --git a/modules/lookup_nisplus.c b/modules/lookup_nisplus.c
index 27f9856..7832611 100644
--- a/modules/lookup_nisplus.c
+++ b/modules/lookup_nisplus.c
@@ -116,8 +116,10 @@ int lookup_reinit(const char *mapfmt,
 
 	new->parse = ctxt->parse;
 	ret = do_init(mapfmt, argc, argv, new, 1);
-	if (ret)
+	if (ret) {
+		free(new);
 		return 1;
+	}
 
 	*context = new;