summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-09-20 04:33:07 +0200
committerAndrew Bartlett <abartlet@samba.org>2013-10-16 23:56:01 +0200
commit556f66bd56415d83be936e28d41946c39e379914 (patch)
tree6a493ff1e889a46f39475496588b6c3728edfd71 /auth
parenta62927ef882a5ed7bee1c737c44dd29b13e724e0 (diff)
downloadsamba-556f66bd56415d83be936e28d41946c39e379914.tar.gz
samba-556f66bd56415d83be936e28d41946c39e379914.tar.bz2
samba-556f66bd56415d83be936e28d41946c39e379914.zip
auth:credentials: avoid talloc_reference in cli_credentials_set_netlogon_creds()
Typically cli_credentials_set_netlogon_creds() should be used directly before the DCERPC bind. And cli_credentials_get_netlogon_creds() should be only used by the gensec layer, which only needs a copy. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Oct 16 23:56:01 CEST 2013 on sn-devel-104
Diffstat (limited to 'auth')
-rw-r--r--auth/credentials/credentials.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c
index 642eef7932..78b59556ea 100644
--- a/auth/credentials/credentials.c
+++ b/auth/credentials/credentials.c
@@ -836,7 +836,11 @@ _PUBLIC_ void cli_credentials_guess(struct cli_credentials *cred,
_PUBLIC_ void cli_credentials_set_netlogon_creds(struct cli_credentials *cred,
struct netlogon_creds_CredentialState *netlogon_creds)
{
- cred->netlogon_creds = talloc_reference(cred, netlogon_creds);
+ TALLOC_FREE(cred->netlogon_creds);
+ if (netlogon_creds == NULL) {
+ return;
+ }
+ cred->netlogon_creds = netlogon_creds_copy(cred, netlogon_creds);
}
/**