summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-05-18 01:05:59 +0000
committerJeremy Allison <jra@samba.org>2004-05-18 01:05:59 +0000
commit4a96324fc1174d2027a91f480300cc804b031991 (patch)
treed3811cf6fc0acb1acf6e0491d9741745c93341cf
parent6ef962c291cad4adc1395d669865dc7b14515556 (diff)
downloadsamba-4a96324fc1174d2027a91f480300cc804b031991.tar.gz
samba-4a96324fc1174d2027a91f480300cc804b031991.tar.xz
samba-4a96324fc1174d2027a91f480300cc804b031991.zip
r764: More memleak fixes in error code path from kawasa_r@itg.hitachi.co.jp.
Jeremy.
-rw-r--r--source/libads/ldap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/libads/ldap.c b/source/libads/ldap.c
index e156857e96f..e018eeb2da9 100644
--- a/source/libads/ldap.c
+++ b/source/libads/ldap.c
@@ -1980,17 +1980,22 @@ ADS_STATUS ads_server_info(ADS_STRUCT *ads)
}
status = ads_do_search(ads, "", LDAP_SCOPE_BASE, "(objectclass=*)", attrs, &res);
- if (!ADS_ERR_OK(status)) return status;
+ if (!ADS_ERR_OK(status)) {
+ talloc_destroy(ctx);
+ return status;
+ }
value = ads_pull_string(ads, ctx, res, "ldapServiceName");
if (!value) {
ads_msgfree(ads, res);
+ talloc_destroy(ctx);
return ADS_ERROR(LDAP_NO_RESULTS_RETURNED);
}
timestr = ads_pull_string(ads, ctx, res, "currentTime");
if (!timestr) {
ads_msgfree(ads, res);
+ talloc_destroy(ctx);
return ADS_ERROR(LDAP_NO_RESULTS_RETURNED);
}