summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-05-07 17:58:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:29 -0500
commita442c65e59cd0b7667087f90522883475dfb7eee (patch)
tree139c568a233ed7352df0a4c22f36ca158481960b /source3/libads
parent88adbfa1f7e136705fad2fe2926e4053808914ab (diff)
downloadsamba-a442c65e59cd0b7667087f90522883475dfb7eee.tar.gz
samba-a442c65e59cd0b7667087f90522883475dfb7eee.tar.bz2
samba-a442c65e59cd0b7667087f90522883475dfb7eee.zip
r562: Memory leak fix in error code path from kawasa_r@itg.hitachi.co.jp.
Jeremy. (This used to be commit ac501348f473045a7846ffd9bc6b9eb4682b8987)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ldap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 20a36dfdf5..e156857e96 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1984,15 +1984,17 @@ ADS_STATUS ads_server_info(ADS_STRUCT *ads)
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);
}
- ldap_msgfree(res);
+ ads_msgfree(ads, res);
p = strchr(value, ':');
if (!p) {
@@ -2054,6 +2056,7 @@ ADS_STATUS ads_domain_sid(ADS_STRUCT *ads, DOM_SID *sid)
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);