git.samba.org
/
metze
/
heimdal
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9eab344
)
gss: free user keytab before resolving system keytab
author
Luke Howard
<lukeh@padl.com>
Thu, 16 Apr 2020 07:19:35 +0000
(07:19 +0000)
committer
Luke Howard
<lukeh@padl.com>
Thu, 16 Apr 2020 07:22:31 +0000
(17:22 +1000)
get_client_keytab() leaked the user keytab if it resolved but we could not find
the client principal. Free it before trying the system keytab.
lib/gssapi/krb5/acquire_cred.c
patch
|
blob
|
history
diff --git
a/lib/gssapi/krb5/acquire_cred.c
b/lib/gssapi/krb5/acquire_cred.c
index 4ccad45dd202c201c70ffaa6c145474757ec1976..ba5d48fadab6b97e7803cc64014bef1117819616 100644
(file)
--- a/
lib/gssapi/krb5/acquire_cred.c
+++ b/
lib/gssapi/krb5/acquire_cred.c
@@
-157,8
+157,14
@@
get_client_keytab(krb5_context context,
krb5_kt_free_entry(context, &entry);
}
- if (ret)
+ if (ret) {
+ if (*keytab) {
+ krb5_kt_close(context, *keytab);
+ *keytab = NULL;
+ }
+
ret = get_system_keytab(context, GSS_C_NO_CRED_STORE, keytab);
+ }
return ret;
}