summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-09-06 12:14:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:43:29 -0500
commit73d25f6f784513aa850de4a7207a1436289c107c (patch)
tree9a7e298b177cdabfca777114ee5174a5506cc8a9
parent30c0e93156817a469a125f5fe7bb466f3bee4cb7 (diff)
downloadsamba-73d25f6f784513aa850de4a7207a1436289c107c.tar.gz
samba-73d25f6f784513aa850de4a7207a1436289c107c.tar.bz2
samba-73d25f6f784513aa850de4a7207a1436289c107c.zip
r18165: Fix memleaks.
Guenther (This used to be commit 6f301b2dc3dd64b4396e1d0307b3d539bda67d45)
-rw-r--r--source3/libads/ldap.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 6c3ab75340..0b7ca46e3e 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -2260,10 +2260,15 @@ ADS_STATUS ads_USN(ADS_STRUCT *ads, uint32 *usn)
return status;
if (ads_count_replies(ads, res) != 1) {
+ ads_msgfree(ads, res);
return ADS_ERROR(LDAP_NO_RESULTS_RETURNED);
}
- ads_pull_uint32(ads, res, "highestCommittedUSN", usn);
+ if (!ads_pull_uint32(ads, res, "highestCommittedUSN", usn)) {
+ ads_msgfree(ads, res);
+ return ADS_ERROR(LDAP_NO_SUCH_ATTRIBUTE);
+ }
+
ads_msgfree(ads, res);
return ADS_SUCCESS;
}
@@ -2325,7 +2330,7 @@ ADS_STATUS ads_current_time(ADS_STRUCT *ads)
timestr = ads_pull_string(ads_s, ctx, res, "currentTime");
if (!timestr) {
- ads_msgfree(ads, res);
+ ads_msgfree(ads_s, res);
status = ADS_ERROR(LDAP_NO_RESULTS_RETURNED);
goto done;
}