hdb: more read_master_key leaks

Change-Id: Icf0bb8dc3cdcd2babb91b4180cec37737772373d
This commit is contained in:
Jeffrey Altman
2016-11-19 08:18:39 -05:00
parent bdfc24e9c0
commit a33b6d6b78

View File

@@ -129,19 +129,16 @@ read_master_keytab(krb5_context context, const char *filename,
goto out;
while(krb5_kt_next_entry(context, id, &entry, &cursor) == 0) {
p = calloc(1, sizeof(*p));
if(p == NULL) {
krb5_kt_end_seq_get(context, id, &cursor);
if (p == NULL) {
ret = ENOMEM;
goto out;
break;
}
p->keytab = entry;
ret = krb5_crypto_init(context, &p->keytab.keyblock, 0, &p->crypto);
if (ret) {
krb5_kt_end_seq_get(context, id, &cursor);
goto out;
}
p->next = *mkey;
*mkey = p;
ret = krb5_crypto_init(context, &p->keytab.keyblock, 0, &p->crypto);
if (ret)
break;
}
krb5_kt_end_seq_get(context, id, &cursor);
out: