diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-24 02:19:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:09 -0500 |
commit | f82a03b2c19e702d70ff92d3f6d1c129dcf84c86 (patch) | |
tree | 7c47ce6d89c140fb366ca76686536e9058512316 | |
parent | af4ce4805ce1504fc8869ead032eabb72fca77a0 (diff) | |
download | samba-f82a03b2c19e702d70ff92d3f6d1c129dcf84c86.tar.gz samba-f82a03b2c19e702d70ff92d3f6d1c129dcf84c86.tar.bz2 samba-f82a03b2c19e702d70ff92d3f6d1c129dcf84c86.zip |
r4955: fixed a couple of minor memory leaks in the auth_sam code
(This used to be commit 2eba223bda43a81e7aa795e58e551b0b556ddcfa)
-rw-r--r-- | source4/auth/auth_sam.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/auth/auth_sam.c b/source4/auth/auth_sam.c index 195cdeb06d..44a8b19cae 100644 --- a/source4/auth/auth_sam.c +++ b/source4/auth/auth_sam.c @@ -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; } |