Other memory leaks in winbind.

kawasa_r at itg.hitachi.co.jp kawasa_r at itg.hitachi.co.jp
Fri May 7 09:39:10 GMT 2004


Other memory leaks in ldap.c. In the following patch, some 'free's
are added.

regards

Index: samba-302/source/libads/ldap.c
===================================================================
RCS file: /cvs/samba-302/source/libads/ldap.c,v
retrieving revision 1.1
diff -u -r1.1 ldap.c
--- samba-302/source/libads/ldap.c	17 Mar 2004 06:32:03 -0000	1.1
+++ samba-302/source/libads/ldap.c	12 Apr 2004 05:31:41 -0000
@@ -1990,11 +1990,13 @@
 
 	value = ads_pull_string(ads, ctx, res, "ldapServiceName");
 	if (!value) {
+		ads_msgfree(ads, res);
 		return ADS_ERROR(LDAP_NO_RESULTS_RETURNED);
 	}
 
 	timestr = ads_pull_string(ads, ctx, res, "currentTime");
 	if (!timestr) {
+		ads_msgfree(ads, res);
 		return ADS_ERROR(LDAP_NO_RESULTS_RETURNED);
 	}
 
@@ -2060,6 +2062,7 @@
 			   attrs, &res);
 	if (!ADS_ERR_OK(rc)) return rc;
 	if (!ads_pull_sid(ads, res, "objectSid", sid)) {
+		ads_msgfree(ads, res);
 		return ADS_ERROR_SYSTEM(ENOENT);
 	}
 	ads_msgfree(ads, res);


More information about the samba-technical mailing list