summaryrefslogtreecommitdiff
path: root/source3/libads/ldap.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libads/ldap.c')
-rw-r--r--source3/libads/ldap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 6fbae51179..1e726f5e55 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1299,6 +1299,7 @@ char *ads_default_ou_string(ADS_STRUCT *ads, const char *wknguid)
SAFE_FREE(base);
if (ads_count_replies(ads, res) != 1) {
+ ads_msgfree(ads, res);
return NULL;
}
@@ -1314,7 +1315,7 @@ char *ads_default_ou_string(ADS_STRUCT *ads, const char *wknguid)
new_ln = wkn_ln - bind_ln;
- ret = wkn_dn_exp[0];
+ ret = SMB_STRDUP(wkn_dn_exp[0]);
for (i=1; i < new_ln; i++) {
char *s;
@@ -1323,6 +1324,7 @@ char *ads_default_ou_string(ADS_STRUCT *ads, const char *wknguid)
free(s);
}
+ ads_msgfree(ads, res);
ads_memfree(ads, wkn_dn);
ldap_value_free(wkn_dn_exp);
ldap_value_free(bind_dn_exp);