kadmind: don't leak ks_tuple

This commit is contained in:
Nicolas Williams
2016-02-29 18:39:54 -06:00
parent 649c4824b0
commit 30299a4ee7

View File

@@ -499,11 +499,13 @@ kadmind_dispatch(void *kadm_handlep, krb5_boolean initial,
ret = krb5_ret_int32(sp, &ks_tuple[i].ks_enctype); ret = krb5_ret_int32(sp, &ks_tuple[i].ks_enctype);
if (ret != 0) { if (ret != 0) {
krb5_free_principal(contextp->context, princ); krb5_free_principal(contextp->context, princ);
free(ks_tuple);
goto fail; goto fail;
} }
ret = krb5_ret_int32(sp, &ks_tuple[i].ks_salttype); ret = krb5_ret_int32(sp, &ks_tuple[i].ks_salttype);
if (ret != 0) { if (ret != 0) {
krb5_free_principal(contextp->context, princ); krb5_free_principal(contextp->context, princ);
free(ks_tuple);
goto fail; goto fail;
} }
} }
@@ -512,6 +514,7 @@ kadmind_dispatch(void *kadm_handlep, krb5_boolean initial,
n_ks_tuple, ks_tuple, &new_keys, n_ks_tuple, ks_tuple, &new_keys,
&n_keys); &n_keys);
krb5_free_principal(contextp->context, princ); krb5_free_principal(contextp->context, princ);
free(ks_tuple);
krb5_storage_free(sp); krb5_storage_free(sp);
sp = krb5_storage_emem(); sp = krb5_storage_emem();