krb5: Fix leaks

This commit is contained in:
Nicolas Williams
2023-01-03 20:45:15 -06:00
parent 21ada15e08
commit 46df04dafb
2 changed files with 6 additions and 5 deletions

View File

@@ -568,6 +568,7 @@ fallback_get_hosts(krb5_context context, struct krb5_krbhst_data *kd,
"Realm %s needs immediate attention "
"see https://icann.org/namecollision",
kd->realm);
free(host);
freeaddrinfo(ai);
return KRB5_KDC_UNREACH;
}

View File

@@ -1855,7 +1855,7 @@ apply_name_canon_rule(krb5_context context, krb5_name_canon_rule rules,
krb5_name_canon_rule_options *rule_opts)
{
krb5_name_canon_rule rule = &rules[rule_idx];
krb5_error_code ret;
krb5_error_code ret = 0;
unsigned int ndots = 0;
krb5_principal nss = NULL;
const char *sname = NULL;
@@ -1900,17 +1900,17 @@ apply_name_canon_rule(krb5_context context, krb5_name_canon_rule rules,
ndots++;
}
if (rule->mindots > 0 && ndots < rule->mindots)
return 0;
goto out;
if (ndots > rule->maxdots)
return 0;
goto out;
if (rule->match_domain != NULL &&
!is_domain_suffix(orig_hostname, rule->match_domain))
return 0;
goto out;
if (rule->match_realm != NULL &&
strcmp(rule->match_realm, in_princ->realm) != 0)
return 0;
goto out;
new_realm = rule->realm;
switch (rule->type) {