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

gd at samba.org gd at samba.org
Tue Jun 13 13:41:05 GMT 2006


Author: gd
Date: 2006-06-13 13:41:04 +0000 (Tue, 13 Jun 2006)
New Revision: 16190

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

Log:
Fix more memleaks.

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-06-13 12:17:36 UTC (rev 16189)
+++ branches/SAMBA_3_0/source/libads/ldap.c	2006-06-13 13:41:04 UTC (rev 16190)
@@ -1213,9 +1213,10 @@
 	status = ads_search_dn(ads, &res, base, attrs);
 	if (!ADS_ERR_OK(status)) {
 		DEBUG(1,("Failed while searching for: %s\n", base));
+		SAFE_FREE(base);
 		return NULL;
 	}
-	free(base);
+	SAFE_FREE(base);
 
 	if (ads_count_replies(ads, res) != 1) {
 		return NULL;
@@ -1242,6 +1243,10 @@
 		free(s);
 	}
 
+	ads_memfree(ads, wkn_dn);
+	ldap_value_free(wkn_dn_exp);
+	ldap_value_free(bind_dn_exp);
+
 	return ret;
 }
 

Modified: trunk/source/libads/ldap.c
===================================================================
--- trunk/source/libads/ldap.c	2006-06-13 12:17:36 UTC (rev 16189)
+++ trunk/source/libads/ldap.c	2006-06-13 13:41:04 UTC (rev 16190)
@@ -1213,9 +1213,10 @@
 	status = ads_search_dn(ads, &res, base, attrs);
 	if (!ADS_ERR_OK(status)) {
 		DEBUG(1,("Failed while searching for: %s\n", base));
+		SAFE_FREE(base);
 		return NULL;
 	}
-	free(base);
+	SAFE_FREE(base);
 
 	if (ads_count_replies(ads, res) != 1) {
 		return NULL;
@@ -1242,6 +1243,10 @@
 		free(s);
 	}
 
+	ads_memfree(ads, wkn_dn);
+	ldap_value_free(wkn_dn_exp);
+	ldap_value_free(bind_dn_exp);
+
 	return ret;
 }
 



More information about the samba-cvs mailing list