mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
r4955: fixed a couple of minor memory leaks in the auth_sam code
This commit is contained in:
parent
8f19b6886c
commit
2eba223bda
@ -357,12 +357,14 @@ static NTSTATUS authsam_make_server_info(TALLOC_CTX *mem_ctx, void *sam_ctx,
|
||||
const char *str;
|
||||
int i;
|
||||
uint_t rid;
|
||||
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
|
||||
|
||||
group_ret = samdb_search(sam_ctx,
|
||||
mem_ctx, NULL, &group_msgs, group_attrs,
|
||||
tmp_ctx, NULL, &group_msgs, group_attrs,
|
||||
"(&(member=%s)(sAMAccountType=*))",
|
||||
msgs[0]->dn);
|
||||
if (group_ret == -1) {
|
||||
talloc_free(tmp_ctx);
|
||||
return NT_STATUS_INTERNAL_DB_CORRUPTION;
|
||||
}
|
||||
|
||||
@ -381,6 +383,8 @@ static NTSTATUS authsam_make_server_info(TALLOC_CTX *mem_ctx, void *sam_ctx,
|
||||
NT_STATUS_HAVE_NO_MEMORY(groupSIDs[i]);
|
||||
}
|
||||
|
||||
talloc_free(tmp_ctx);
|
||||
|
||||
str = ldb_msg_find_string(msgs[0], "objectSid", NULL);
|
||||
account_sid = dom_sid_parse_talloc(server_info, str);
|
||||
NT_STATUS_HAVE_NO_MEMORY(account_sid);
|
||||
@ -481,6 +485,9 @@ NTSTATUS sam_get_server_info(TALLOC_CTX *mem_ctx, const char *account_name, cons
|
||||
server_info);
|
||||
NT_STATUS_NOT_OK_RETURN(nt_status);
|
||||
|
||||
talloc_free(msgs);
|
||||
talloc_free(domain_msgs);
|
||||
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
@ -519,6 +526,9 @@ static NTSTATUS authsam_check_password_internals(struct auth_method_context *ctx
|
||||
server_info);
|
||||
NT_STATUS_NOT_OK_RETURN(nt_status);
|
||||
|
||||
talloc_free(msgs);
|
||||
talloc_free(domain_msgs);
|
||||
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user