From a442c65e59cd0b7667087f90522883475dfb7eee Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 7 May 2004 17:58:06 +0000 Subject: r562: Memory leak fix in error code path from kawasa_r@itg.hitachi.co.jp. Jeremy. (This used to be commit ac501348f473045a7846ffd9bc6b9eb4682b8987) --- source3/libads/ldap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3') 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); -- cgit