krb5: Fix leak in gethostlist()

This commit is contained in:
Nicolas Williams
2020-09-07 21:53:30 -05:00
parent fbb3bd3f8b
commit 0a0bf32935

View File

@@ -1093,6 +1093,7 @@ gethostlist(krb5_context context, const char *realm,
if (nhost == 0) {
krb5_set_error_message(context, KRB5_KDC_UNREACH,
N_("No KDC found for realm %s", ""), realm);
krb5_krbhst_free(context, handle);
return KRB5_KDC_UNREACH;
}
*hostlist = calloc(nhost + 1, sizeof(**hostlist));