autofs-5.1.1 - fix memory leak in ldap do_init()
From: Ian Kent <raven@themaw.net>
Fix error return without free of temporory allocated storage in
do_init().
Signed-off-by: Ian Kent <raven@themaw.net>
---
CHANGELOG | 1 +
modules/lookup_ldap.c | 1 +
2 files changed, 2 insertions(+)
--- autofs-5.0.7.orig/CHANGELOG
+++ autofs-5.0.7/CHANGELOG
@@ -199,6 +199,7 @@
- fix unbind sasl external mech.
- fix sasl connection concurrancy problem.
- fix memory leak in nisplus lookup_reinit().
+- fix memory leak in ldap do_init().
25/07/2012 autofs-5.0.7
=======================
--- autofs-5.0.7.orig/modules/lookup_ldap.c
+++ autofs-5.0.7/modules/lookup_ldap.c
@@ -1752,6 +1752,7 @@ static int do_init(const char *mapfmt,
*/
if (!parse_server_string(LOGOPT_NONE, tmp, ctxt)) {
error(LOGOPT_ANY, MODPREFIX "cannot parse server string");
+ free(tmp);
return 1;
}
free(tmp);