- improve mount location error reporting. - fix paged query more results check. - fix dumpmaps not reading maps. - fix result null check in read_one_map(). - Fix LDAP result leaks on error paths. - code analysis fixes 1. - fix not bind mounting local filesystem. - update dir map-type patch for changed patch order. - fix wait for master source mutex. - fix submount shutdown race - fix fix map source check in file lookup. - add disable move mount configure option.
57 lines
1.7 KiB
Diff
57 lines
1.7 KiB
Diff
autofs-5.0.6 - Fix LDAP result leaks on error paths
|
|
|
|
From: Leonardo Chiquitto <leonardo.lists@gmail.com>
|
|
|
|
According to ldap_search_s(3), the result structure must be freed
|
|
with ldap_msgfree() even when the search function returned failure.
|
|
---
|
|
|
|
CHANGELOG | 1 +
|
|
modules/lookup_ldap.c | 6 ++++++
|
|
2 files changed, 7 insertions(+), 0 deletions(-)
|
|
|
|
|
|
diff --git a/CHANGELOG b/CHANGELOG
|
|
index 66b804f..dc91c25 100644
|
|
--- a/CHANGELOG
|
|
+++ b/CHANGELOG
|
|
@@ -5,6 +5,7 @@
|
|
- fix paged query more results check.
|
|
- fix dumpmaps not reading maps.
|
|
- fix result null check in read_one_map().
|
|
+- fix LDAP result leaks on error paths.
|
|
|
|
28/06/2011 autofs-5.0.6
|
|
-----------------------
|
|
diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
|
|
index 22ff355..29323b2 100644
|
|
--- a/modules/lookup_ldap.c
|
|
+++ b/modules/lookup_ldap.c
|
|
@@ -347,6 +347,8 @@ static int get_query_dn(unsigned logopt, LDAP *ldap, struct lookup_context *ctxt
|
|
error(logopt,
|
|
MODPREFIX "query failed for %s: %s",
|
|
query, ldap_err2string(rv));
|
|
+ if (result)
|
|
+ ldap_msgfree(result);
|
|
free(query);
|
|
return 0;
|
|
}
|
|
@@ -1573,6 +1575,8 @@ int lookup_read_master(struct master *master, time_t age, void *context)
|
|
error(logopt, MODPREFIX "query failed for %s: %s",
|
|
query, ldap_err2string(rv));
|
|
unbind_ldap_connection(logging, ldap, ctxt);
|
|
+ if (result)
|
|
+ ldap_msgfree(result);
|
|
free(query);
|
|
return NSS_STATUS_NOTFOUND;
|
|
}
|
|
@@ -2586,6 +2590,8 @@ static int lookup_one(struct autofs_point *ap,
|
|
if ((rv != LDAP_SUCCESS) || !result) {
|
|
crit(ap->logopt, MODPREFIX "query failed for %s", query);
|
|
unbind_ldap_connection(ap->logopt, ldap, ctxt);
|
|
+ if (result)
|
|
+ ldap_msgfree(result);
|
|
free(query);
|
|
return CHE_FAIL;
|
|
}
|