diff options
author | Volker Lendecke <vl@samba.org> | 2010-06-28 12:26:17 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-06-28 12:28:07 +0200 |
commit | c4d5cbbdc52504b950b082b8340e32735d48e92c (patch) | |
tree | 474cb31029ff243c0cf73941808afe742c0d6f16 /source3 | |
parent | a81b97ff340e021c3d2a7ddfe44ec09cc2b9f0d5 (diff) | |
download | samba-c4d5cbbdc52504b950b082b8340e32735d48e92c.tar.gz samba-c4d5cbbdc52504b950b082b8340e32735d48e92c.tar.xz samba-c4d5cbbdc52504b950b082b8340e32735d48e92c.zip |
s3: Fix some valgrind errors
Essentially the same change as 15297ee, this time for the client side.
Günther, Andrew B, please check!
Thanks,
Volker
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/ntlmssp.c | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c index 870f6c5149b..228d19536ea 100644 --- a/source3/libsmb/ntlmssp.c +++ b/source3/libsmb/ntlmssp.c @@ -900,8 +900,6 @@ NTSTATUS ntlmssp_server_start(TALLOC_CTX *mem_ctx, static NTSTATUS ntlmssp_client_initial(struct ntlmssp_state *ntlmssp_state, DATA_BLOB reply, DATA_BLOB *next_request) { - struct NEGOTIATE_MESSAGE negotiate; - if (ntlmssp_state->unicode) { ntlmssp_state->neg_flags |= NTLMSSP_NEGOTIATE_UNICODE; } else { @@ -921,11 +919,17 @@ static NTSTATUS ntlmssp_client_initial(struct ntlmssp_state *ntlmssp_state, ntlmssp_state->client.netbios_name); if (DEBUGLEVEL >= 10) { - if (NT_STATUS_IS_OK(ntlmssp_pull_NEGOTIATE_MESSAGE(next_request, - ntlmssp_state, - &negotiate))) - { - NDR_PRINT_DEBUG(NEGOTIATE_MESSAGE, &negotiate); + struct NEGOTIATE_MESSAGE *negotiate = talloc( + talloc_tos(), struct NEGOTIATE_MESSAGE); + if (negotiate != NULL) { + NTSTATUS status; + status = ntlmssp_pull_NEGOTIATE_MESSAGE( + next_request, negotiate, negotiate); + if (NT_STATUS_IS_OK(status)) { + NDR_PRINT_DEBUG(NEGOTIATE_MESSAGE, + negotiate); + } + TALLOC_FREE(negotiate); } } @@ -958,8 +962,6 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state, DATA_BLOB session_key = data_blob_null; DATA_BLOB encrypted_session_key = data_blob_null; NTSTATUS nt_status = NT_STATUS_OK; - struct CHALLENGE_MESSAGE challenge; - struct AUTHENTICATE_MESSAGE authenticate; if (ntlmssp_state->use_ccache) { struct wbcCredentialCacheParams params; @@ -1025,11 +1027,18 @@ noccache: } if (DEBUGLEVEL >= 10) { - if (NT_STATUS_IS_OK(ntlmssp_pull_CHALLENGE_MESSAGE(&reply, - ntlmssp_state, - &challenge))) - { - NDR_PRINT_DEBUG(CHALLENGE_MESSAGE, &challenge); + struct CHALLENGE_MESSAGE *challenge = talloc( + talloc_tos(), struct CHALLENGE_MESSAGE); + if (challenge != NULL) { + NTSTATUS status; + challenge->NegotiateFlags = chal_flags; + status = ntlmssp_pull_CHALLENGE_MESSAGE( + &reply, challenge, challenge); + if (NT_STATUS_IS_OK(status)) { + NDR_PRINT_DEBUG(CHALLENGE_MESSAGE, + challenge); + } + TALLOC_FREE(challenge); } } @@ -1213,11 +1222,19 @@ noccache: } if (DEBUGLEVEL >= 10) { - if (NT_STATUS_IS_OK(ntlmssp_pull_AUTHENTICATE_MESSAGE(next_request, - ntlmssp_state, - &authenticate))) - { - NDR_PRINT_DEBUG(AUTHENTICATE_MESSAGE, &authenticate); + struct AUTHENTICATE_MESSAGE *authenticate = talloc( + talloc_tos(), struct AUTHENTICATE_MESSAGE); + if (authenticate != NULL) { + NTSTATUS status; + authenticate->NegotiateFlags = + ntlmssp_state->neg_flags; + status = ntlmssp_pull_AUTHENTICATE_MESSAGE( + next_request, authenticate, authenticate); + if (NT_STATUS_IS_OK(status)) { + NDR_PRINT_DEBUG(AUTHENTICATE_MESSAGE, + authenticate); + } + TALLOC_FREE(authenticate); } } |