summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2012-12-24 10:01:30 -0800
committerAndrew Bartlett <abartlet@samba.org>2013-02-08 15:06:25 +1100
commit123954d94ee783bd241c89fa53fc902312176875 (patch)
tree05108c934582e7137d3c35163a751cd28a30b3da /source4
parent64eba0a8421bf4648f79085dd23b3e55d5a322df (diff)
downloadsamba-123954d94ee783bd241c89fa53fc902312176875.tar.gz
samba-123954d94ee783bd241c89fa53fc902312176875.tar.bz2
samba-123954d94ee783bd241c89fa53fc902312176875.zip
dsdb-cracknames: Fix potential double free and memory leaks
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/cracknames.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/cracknames.c b/source4/dsdb/samdb/cracknames.c
index bcf82c6238..15463a7875 100644
--- a/source4/dsdb/samdb/cracknames.c
+++ b/source4/dsdb/samdb/cracknames.c
@@ -394,10 +394,10 @@ static WERROR get_format_functional_filtering_param(struct ldb_context *sam_ctx,
account = name;
s = strchr(account, '/');
+ talloc_free(domain_res);
while(s) {
s[0] = '\0';
s++;
- talloc_free(domain_res);
ldb_ret = ldb_search(sam_ctx, mem_ctx, &domain_res,
tmp_dn,
@@ -410,18 +410,20 @@ static WERROR get_format_functional_filtering_param(struct ldb_context *sam_ctx,
info1->status = DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR;
return WERR_OK;
}
+ talloc_free(tmp_dn);
switch (domain_res->count) {
case 1:
break;
case 0:
+ talloc_free(domain_res);
info1->status = DRSUAPI_DS_NAME_STATUS_NOT_FOUND;
return WERR_OK;
default:
+ talloc_free(domain_res);
info1->status = DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE;
return WERR_OK;
}
- talloc_free(tmp_dn);
tmp_dn = talloc_steal(mem_ctx, domain_res->msgs[0]->dn);
talloc_free(domain_res);
search_dn = tmp_dn;