mirror of
https://github.com/samba-team/samba.git
synced 2025-11-05 04:23:51 +03:00
s3: krb5: keytab - The done label can be jumped to with context == NULL.
Ensure we don't crash in this case. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11959 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Thu Jun 9 13:18:56 CEST 2016 on sn-devel-144
This commit is contained in:
committed by
Uri Simchoni
parent
0e2711b2a0
commit
e46cb9b835
@@ -552,26 +552,24 @@ done:
|
||||
TALLOC_FREE(oldEntries);
|
||||
TALLOC_FREE(frame);
|
||||
|
||||
{
|
||||
if (context) {
|
||||
krb5_keytab_entry zero_kt_entry;
|
||||
krb5_kt_cursor zero_csr;
|
||||
|
||||
ZERO_STRUCT(zero_kt_entry);
|
||||
ZERO_STRUCT(zero_csr);
|
||||
|
||||
if (memcmp(&zero_kt_entry, &kt_entry,
|
||||
sizeof(krb5_keytab_entry))) {
|
||||
smb_krb5_kt_free_entry(context, &kt_entry);
|
||||
}
|
||||
}
|
||||
{
|
||||
krb5_kt_cursor zero_csr;
|
||||
ZERO_STRUCT(zero_csr);
|
||||
if ((memcmp(&cursor, &zero_csr,
|
||||
sizeof(krb5_kt_cursor)) != 0) && keytab) {
|
||||
krb5_kt_end_seq_get(context, keytab, &cursor);
|
||||
}
|
||||
}
|
||||
if (keytab) {
|
||||
krb5_kt_close(context, keytab);
|
||||
}
|
||||
if (context) {
|
||||
if (keytab) {
|
||||
krb5_kt_close(context, keytab);
|
||||
}
|
||||
krb5_free_context(context);
|
||||
}
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user