Author: gd
Date: 2007-02-14 20:52:23 +0000 (Wed, 14 Feb 2007)
New Revision: 21349

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

Log:
Fix memleak in ads_upn_suffixes().

Guenther

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


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ldap.c
===================================================================
--- branches/SAMBA_3_0/source/libads/ldap.c     2007-02-14 19:59:30 UTC (rev 
21348)
+++ branches/SAMBA_3_0/source/libads/ldap.c     2007-02-14 20:52:23 UTC (rev 
21349)
@@ -2638,9 +2638,12 @@
 
        config_context = ads_pull_string(ads, mem_ctx, res, 
"configurationNamingContext");
        if (config_context == NULL) {
+               ads_msgfree(ads, res);
                return ADS_ERROR(LDAP_NO_MEMORY);
        }
 
+       ads_msgfree(ads, res);
+
        base = talloc_asprintf(mem_ctx, "cn=Partitions,%s", config_context);
        if (base == NULL) {
                return ADS_ERROR(LDAP_NO_MEMORY);

Modified: branches/SAMBA_3_0_25/source/libads/ldap.c
===================================================================
--- branches/SAMBA_3_0_25/source/libads/ldap.c  2007-02-14 19:59:30 UTC (rev 
21348)
+++ branches/SAMBA_3_0_25/source/libads/ldap.c  2007-02-14 20:52:23 UTC (rev 
21349)
@@ -2638,9 +2638,12 @@
 
        config_context = ads_pull_string(ads, mem_ctx, res, 
"configurationNamingContext");
        if (config_context == NULL) {
+               ads_msgfree(ads, res);
                return ADS_ERROR(LDAP_NO_MEMORY);
        }
 
+       ads_msgfree(ads, res);
+
        base = talloc_asprintf(mem_ctx, "cn=Partitions,%s", config_context);
        if (base == NULL) {
                return ADS_ERROR(LDAP_NO_MEMORY);

Reply via email to