diff options
author | Jeremy Allison <jra@samba.org> | 2010-07-20 13:35:43 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2010-07-20 13:35:43 -0700 |
commit | 4ed9437b7e24365b9acd179b6553793db95a4c54 (patch) | |
tree | be148ed36f2f057a596e366b35e5b99380b1d370 /source3/libsmb/cliconnect.c | |
parent | dc443ee6e9e97c08bcceaa1cbc155635e73e8118 (diff) | |
download | samba-4ed9437b7e24365b9acd179b6553793db95a4c54.tar.gz |
Add TALLOC_CTX argument to spnego_parse_negTokenInit, reduce
use of malloc, and data_blob().
Jeremy.
Diffstat (limited to 'source3/libsmb/cliconnect.c')
-rw-r--r-- | source3/libsmb/cliconnect.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index dc3f236609f..86338d0ef35 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -1225,7 +1225,7 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user, * negprot reply. It is WRONG to depend on the principal sent in the * negprot reply, but right now we do it. If we don't receive one, * we try to best guess, then fall back to NTLM. */ - if (!spnego_parse_negTokenInit(blob, OIDs, &principal, NULL)) { + if (!spnego_parse_negTokenInit(talloc_tos(), blob, OIDs, &principal, NULL)) { data_blob_free(&blob); return ADS_ERROR_NT(NT_STATUS_INVALID_PARAMETER); } @@ -1248,6 +1248,7 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user, status = cli_set_username(cli, user); if (!NT_STATUS_IS_OK(status)) { + TALLOC_FREE(principal); return ADS_ERROR_NT(status); } @@ -1299,6 +1300,7 @@ ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user, machine = SMB_STRDUP(cli->desthost); } if (machine == NULL) { + TALLOC_FREE(principal); return ADS_ERROR_NT(NT_STATUS_NO_MEMORY); } |