summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-06-19 00:54:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:59 -0500
commitf38c27b4e092f5846bf1b547405df68e4bf3391d (patch)
tree9abbacfb4e5a3ea8ac72f7e01947a2235c43003a /source3/libads
parentd703c350cbbd04d7cea79575dc1bfec284cb1cb5 (diff)
downloadsamba-f38c27b4e092f5846bf1b547405df68e4bf3391d.tar.gz
samba-f38c27b4e092f5846bf1b547405df68e4bf3391d.tar.bz2
samba-f38c27b4e092f5846bf1b547405df68e4bf3391d.zip
r1193: Ensure we check for and use krb5_free_unparsed_name().
Jeremy. (This used to be commit af5a08f5ad895cb33c9134771da19ba5e709e742)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/kerberos_keytab.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/libads/kerberos_keytab.c b/source3/libads/kerberos_keytab.c
index 95ff0c1cf3..605c7e1b1a 100644
--- a/source3/libads/kerberos_keytab.c
+++ b/source3/libads/kerberos_keytab.c
@@ -154,7 +154,8 @@ int ads_keytab_add_entry(const char *srvPrinc, ADS_STRUCT *ads)
#else
compare_ok = ((strcmp(ktprinc, princ_s) == 0) && (kt_entry.vno != kvno - 1));
#endif
- SAFE_FREE(ktprinc);
+ krb5_free_unparsed_name(ktprinc);
+ ktprinc = NULL;
if (compare_ok) {
DEBUG(3,("ads_keytab_add_entry: Found old entry for principal: %s (kvno %d) - trying to remove it.\n",
@@ -479,7 +480,7 @@ int ads_keytab_create_default(ADS_STRUCT *ads)
if (ret != KRB5_KT_END && ret != ENOENT ) {
while ((ret = krb5_kt_next_entry(context, keytab, &kt_entry, &cursor)) == 0) {
if (kt_entry.vno != kvno) {
- char *ktprinc;
+ char *ktprinc = NULL;
char *p;
/* This returns a malloc'ed string in ktprinc. */
@@ -512,7 +513,7 @@ int ads_keytab_create_default(ADS_STRUCT *ads)
}
for (i = 0; oldEntries[i]; i++) {
ret |= ads_keytab_add_entry(oldEntries[i], ads);
- SAFE_FREE(oldEntries[i]);
+ krb5_free_unparsed_name(oldEntries[i]);
}
krb5_kt_end_seq_get(context, keytab, &cursor);
}