File autofs-5.0.6-fix-fix-ldap-result-leaks-on-error-paths.patch of Package autofs.import5769
commit e2178565b79d5f84e99d60e668f66979a54a0ac7
Author: Ian Kent <raven@themaw.net>
Date: Thu Dec 1 15:24:45 2011 +0800
autofs-5.0.6 - fix fix LDAP result leaks on error paths
The previous patch with which ensured that the result struture returned
from ldap_search_s(3) was freed could sometimes lead to a segmentation
fault because the local variable used was not initialized before use.
Index: autofs-5.0.5/CHANGELOG
===================================================================
--- autofs-5.0.5.orig/CHANGELOG
+++ autofs-5.0.5/CHANGELOG
@@ -84,6 +84,7 @@
- fix dumpmaps not reading maps.
- fix result null check in read_one_map().
- fix LDAP result leaks on error paths.
+- fix fix LDAP result leaks on error paths.
03/09/2009 autofs-5.0.5
-----------------------
Index: autofs-5.0.5/modules/lookup_ldap.c
===================================================================
--- autofs-5.0.5.orig/modules/lookup_ldap.c
+++ autofs-5.0.5/modules/lookup_ldap.c
@@ -279,7 +279,7 @@ static int get_query_dn(unsigned logopt,
{
char buf[MAX_ERR_BUF];
char *query, *dn, *qdn;
- LDAPMessage *result, *e;
+ LDAPMessage *result = NULL, *e;
struct ldap_searchdn *sdns = NULL;
char *attrs[2];
struct berval **value;
@@ -1508,7 +1508,7 @@ int lookup_read_master(struct master *ma
char buf[MAX_ERR_BUF];
char parse_buf[PARSE_MAX_BUF];
char *query;
- LDAPMessage *result, *e;
+ LDAPMessage *result = NULL, *e;
char *class, *info, *entry;
char **keyValue = NULL;
char **values = NULL;
@@ -2454,7 +2454,7 @@ static int lookup_one(struct autofs_poin
char buf[MAX_ERR_BUF];
time_t age = time(NULL);
char *query;
- LDAPMessage *result, *e;
+ LDAPMessage *result = NULL, *e;
char *class, *info, *entry;
char *enc_key1, *enc_key2;
int enc_len1 = 0, enc_len2 = 0;