Skip Menu |
 

From: Arlene Berry <aberry@likewise.com>
To: "krb5-bugs@mit.edu" <krb5-bugs@mit.edu>
Subject: potential memory leak in krb5int_get_fq_hostname
Date: Fri, 3 Feb 2012 01:40:18 +0000
Krb5int_get_fq_hostname calls getaddrinfo but, if ai->ai_canonname is 0, it returns without freeing ai.

Index: src/lib/krb5/os/hst_realm.c
===================================================================
--- src/lib/krb5/os/hst_realm.c (revision 25666)
+++ src/lib/krb5/os/hst_realm.c (working copy)
@@ -112,7 +112,10 @@
if (err)
return krb5int_translate_gai_error (err);
if (ai->ai_canonname == 0)
+ {
+ freeaddrinfo (ai);
return KRB5_EAI_FAIL;
+ }
strncpy (buf, ai->ai_canonname, bufsize);
buf[bufsize-1] = 0;
freeaddrinfo (ai);
From: ghudson@mit.edu
Subject: SVN Commit

Fix a minor memory leak in get_fq_hostname

https://github.com/krb5/krb5/commit/ca58ab4f8665cf5f93e7a2b29844ec3cd1f2b5c7
Author: Arlene Berry <aberry@likewise.com>
Committer: Greg Hudson <ghudson@mit.edu>
Commit: ca58ab4f8665cf5f93e7a2b29844ec3cd1f2b5c7
Branch: master
src/lib/krb5/os/hst_realm.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
From: tlyu@mit.edu
Subject: SVN Commit

Fix typo in previous change to get_fq_hostname

https://github.com/krb5/krb5/commit/178a98e4bf51df6e3bb574a2ea2c49250ef1537f
Author: Tom Yu <tlyu@mit.edu>
Commit: 178a98e4bf51df6e3bb574a2ea2c49250ef1537f
Branch: master
src/lib/krb5/os/hst_realm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Just for the record, the typo was mine, not Arlene's; I applied the
change by hand and committed it too hastily before running out the door.