summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libads/ldap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 7b8b41b10a..7fb5dac51b 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1213,9 +1213,10 @@ char *ads_default_ou_string(ADS_STRUCT *ads, const char *wknguid)
status = ads_search_dn(ads, &res, base, attrs);
if (!ADS_ERR_OK(status)) {
DEBUG(1,("Failed while searching for: %s\n", base));
+ SAFE_FREE(base);
return NULL;
}
- free(base);
+ SAFE_FREE(base);
if (ads_count_replies(ads, res) != 1) {
return NULL;
@@ -1242,6 +1243,10 @@ char *ads_default_ou_string(ADS_STRUCT *ads, const char *wknguid)
free(s);
}
+ ads_memfree(ads, wkn_dn);
+ ldap_value_free(wkn_dn_exp);
+ ldap_value_free(bind_dn_exp);
+
return ret;
}