In ads_keytab_creat_default(), if the keytab to be created cannot
be opened, the bail-out code calls smb_krb5_kt_free_entry() on
an uninitialized entry.
To reproduce:
1. Join a domain
2. KRB5_KTNAME=FILE:/non-existant-path/krb5.keytab net ads keytab create -P
Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
size_t i;
ADS_STATUS status;
+ ZERO_STRUCT(kt_entry);
+ ZERO_STRUCT(cursor);
+
frame = talloc_stackframe();
if (frame == NULL) {
ret = -1;
#endif
memset(princ_s, '\0', sizeof(princ_s));
- ZERO_STRUCT(kt_entry);
- ZERO_STRUCT(cursor);
initialize_krb5_error_table();
ret = krb5_init_context(&context);