summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-03-03 11:34:04 +1100
committerAndrew Bartlett <abartlet@samba.org>2010-04-10 21:40:58 +1000
commit18f0e24f5573611c983d2d5d37409fa77b199dd5 (patch)
tree58f1eae2cbca0d240915857e7da50eb6a4eaecf5
parent5beaef7cde3c311e4543abf71e5fe9794d62cc6e (diff)
downloadsamba-18f0e24f5573611c983d2d5d37409fa77b199dd5.tar.gz
samba-18f0e24f5573611c983d2d5d37409fa77b199dd5.tar.bz2
samba-18f0e24f5573611c983d2d5d37409fa77b199dd5.zip
s4:credentials talloc_free() any previous salt_principal
This isn't used often, but it is generally better not to leak it onto what may be a longer-term context. Andrew Bartlett
-rw-r--r--source4/auth/credentials/credentials.h2
-rw-r--r--source4/auth/credentials/credentials_krb5.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/source4/auth/credentials/credentials.h b/source4/auth/credentials/credentials.h
index 6c077c9bec..33de8341c7 100644
--- a/source4/auth/credentials/credentials.h
+++ b/source4/auth/credentials/credentials.h
@@ -76,7 +76,7 @@ struct cli_credentials {
const char *domain;
const char *realm;
const char *principal;
- const char *salt_principal;
+ char *salt_principal;
const char *bind_dn;
diff --git a/source4/auth/credentials/credentials_krb5.c b/source4/auth/credentials/credentials_krb5.c
index e04b7f5926..d8ce0e58e2 100644
--- a/source4/auth/credentials/credentials_krb5.c
+++ b/source4/auth/credentials/credentials_krb5.c
@@ -798,6 +798,7 @@ const char *cli_credentials_get_salt_principal(struct cli_credentials *cred)
_PUBLIC_ void cli_credentials_set_salt_principal(struct cli_credentials *cred, const char *principal)
{
+ talloc_free(cred->salt_principal);
cred->salt_principal = talloc_strdup(cred, principal);
}