summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5
diff options
context:
space:
mode:
authorArlene Berry <aberry@likewise.com>2012-07-03 15:20:54 -0400
committerGreg Hudson <ghudson@mit.edu>2012-07-03 15:25:44 -0400
commitca58ab4f8665cf5f93e7a2b29844ec3cd1f2b5c7 (patch)
tree38c090ebaef241e6263acabe98268d1aeeabc5be /src/lib/krb5
parentac94bfad7852075360852fa5602d9ff819b27cf0 (diff)
downloadkrb5-ca58ab4f8665cf5f93e7a2b29844ec3cd1f2b5c7.tar.gz
krb5-ca58ab4f8665cf5f93e7a2b29844ec3cd1f2b5c7.tar.xz
krb5-ca58ab4f8665cf5f93e7a2b29844ec3cd1f2b5c7.zip
Fix a minor memory leak in get_fq_hostname
ticket: 7086
Diffstat (limited to 'src/lib/krb5')
-rw-r--r--src/lib/krb5/os/hst_realm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/krb5/os/hst_realm.c b/src/lib/krb5/os/hst_realm.c
index 9266222239..3665685b65 100644
--- a/src/lib/krb5/os/hst_realm.c
+++ b/src/lib/krb5/os/hst_realm.c
@@ -111,8 +111,10 @@ get_fq_hostname(char *buf, size_t bufsize, const char *name)
err = getaddrinfo (name, 0, &hints, &ai);
if (err)
return krb5int_translate_gai_error (err);
- if (ai->ai_canonname == 0)
+ if (ai->ai_canonname == NULL) {
+ freaddrinfo(ai);
return KRB5_EAI_FAIL;
+ }
strncpy (buf, ai->ai_canonname, bufsize);
buf[bufsize-1] = 0;
freeaddrinfo (ai);