Skip to content

Commit

Permalink
Fix memory leak parsing name with default realm
Browse files Browse the repository at this point in the history
After 74beb75, allocate_princ()
allocates a one-byte realm field even if the principal doesn't have
one, so if we're replacing it with the default realm, we need to free
that.
  • Loading branch information
greghudson committed Aug 7, 2012
1 parent 97104ee commit 7abd340
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/krb5/krb/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ krb5_parse_name_flags(krb5_context context, const char *name,
ret = krb5_get_default_realm(context, &default_realm);
if (ret)
goto cleanup;
krb5_free_data_contents(context, &princ->realm);
princ->realm = string2data(default_realm);
}
} else if (no_realm) {
Expand Down

0 comments on commit 7abd340

Please sign in to comment.