svn commit: samba r15461 - branches/SAMBA_3_0/source/libads trunk/source/libads

gd at samba.org gd at samba.org
Fri May 5 15:54:12 GMT 2006


Author: gd
Date: 2006-05-05 15:54:11 +0000 (Fri, 05 May 2006)
New Revision: 15461

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15461

Log:
Free LDAP result in ads_get_attrname_by_oid().

Guenther

Modified:
   branches/SAMBA_3_0/source/libads/ldap.c
   trunk/source/libads/ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ldap.c
===================================================================
--- branches/SAMBA_3_0/source/libads/ldap.c	2006-05-05 15:44:00 UTC (rev 15460)
+++ branches/SAMBA_3_0/source/libads/ldap.c	2006-05-05 15:54:11 UTC (rev 15461)
@@ -2471,6 +2471,7 @@
 	void *res = NULL;
 	char *expr = NULL;
 	const char *attrs[] = { "lDAPDisplayName", NULL };
+	char *result;
 
 	if (ads == NULL || mem_ctx == NULL || OID == NULL) {
 		goto failed;
@@ -2492,12 +2493,16 @@
 		goto failed;
 	}
 
-	return ads_pull_string(ads, mem_ctx, res, "lDAPDisplayName");
+	result = ads_pull_string(ads, mem_ctx, res, "lDAPDisplayName");
+	ads_msgfree(ads, res);
+
+	return result;
 	
 failed:
 	DEBUG(0,("ads_get_attrname_by_oid: failed to retrieve name for oid: %s\n", 
 		OID));
 	
+	ads_msgfree(ads, res);
 	return NULL;
 }
 

Modified: trunk/source/libads/ldap.c
===================================================================
--- trunk/source/libads/ldap.c	2006-05-05 15:44:00 UTC (rev 15460)
+++ trunk/source/libads/ldap.c	2006-05-05 15:54:11 UTC (rev 15461)
@@ -2471,6 +2471,7 @@
 	void *res = NULL;
 	char *expr = NULL;
 	const char *attrs[] = { "lDAPDisplayName", NULL };
+	char *result;
 
 	if (ads == NULL || mem_ctx == NULL || OID == NULL) {
 		goto failed;
@@ -2492,12 +2493,16 @@
 		goto failed;
 	}
 
-	return ads_pull_string(ads, mem_ctx, res, "lDAPDisplayName");
+	result = ads_pull_string(ads, mem_ctx, res, "lDAPDisplayName");
+	ads_msgfree(ads, res);
+
+	return result;
 	
 failed:
 	DEBUG(0,("ads_get_attrname_by_oid: failed to retrieve name for oid: %s\n", 
 		OID));
 	
+	ads_msgfree(ads, res);
 	return NULL;
 }
 



More information about the samba-cvs mailing list