1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-14 12:23:52 +03:00

r2654: fixed some more server memory leaks. We are now down to a single leak

of 16 bytes, caused by the 16 byte data_blob in the smb_signing
code.
This commit is contained in:
Andrew Tridgell
2004-09-26 06:44:08 +00:00
committed by Gerald (Jerry) Carter
parent 0cf427d14f
commit 2f1b788e09
9 changed files with 26 additions and 10 deletions

View File

@@ -39,6 +39,8 @@ static NTSTATUS sam_password_ok(const struct auth_context *auth_context,
DATA_BLOB *user_sess_key,
DATA_BLOB *lm_sess_key)
{
NTSTATUS status;
if (acct_flags & ACB_PWNOTREQ) {
if (lp_null_passwords()) {
DEBUG(3,("Account for user '%s' has no password and null passwords are allowed.\n",
@@ -51,7 +53,7 @@ static NTSTATUS sam_password_ok(const struct auth_context *auth_context,
}
}
return ntlm_password_check(mem_ctx, &auth_context->challenge,
status = ntlm_password_check(mem_ctx, &auth_context->challenge,
&user_info->lm_resp, &user_info->nt_resp,
&user_info->lm_interactive_password,
&user_info->nt_interactive_password,
@@ -59,6 +61,17 @@ static NTSTATUS sam_password_ok(const struct auth_context *auth_context,
user_info->smb_name.str,
user_info->client_domain.str,
lm_pwd->hash, nt_pwd->hash, user_sess_key, lm_sess_key);
if (NT_STATUS_IS_OK(status)) {
if (user_sess_key && user_sess_key->data) {
talloc_steal(auth_context, user_sess_key->data);
}
if (lm_sess_key && lm_sess_key->data) {
talloc_steal(auth_context, lm_sess_key->data);
}
}
return status;
}
@@ -330,8 +343,7 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
}
if (group_ret > 0 &&
!(groupSIDs = talloc_realloc_p(groupSIDs,
struct dom_sid *, group_ret))) {
!(groupSIDs = talloc_array_p(*server_info, struct dom_sid *, group_ret))) {
talloc_free(*server_info);
return NT_STATUS_NO_MEMORY;
}