[krbdev.mit.edu #8700] Resource leak in krb5int_get_fq_local_hostname()

Bean Zhang via RT rt-comment at KRBDEV-PROD-APP-1.mit.edu
Tue Jun 19 11:26:24 EDT 2018


Hi Team,

In krb5int_get_fq_local_hostname() of krb5-1.16.1/src/lib/krb5/os/hostrealm.c,
When calls getaddrinfo(), will store the allocated memory to ai,
later if strlcpy() fails, this function returns without freeing the memory that ai points to.

The fix is to call "freeaddrinfo(ai)" if this function returns on calling strlcpy() failure.

Could someone help to take a look?

Thanks,
Bean



More information about the krb5-bugs mailing list