[30232] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Fix minor leak in krb5_get_fallback_host_realm()

daemon@ATHENA.MIT.EDU (Greg Hudson)
Fri Jun 15 11:08:21 2018

Date: Fri, 15 Jun 2018 11:08:14 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201806151508.w5FF8Esh024460@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/80ea4fe833c72e3be47509a3216eee726c5fdb26
commit 80ea4fe833c72e3be47509a3216eee726c5fdb26
Author: Greg Hudson <ghudson@mit.edu>
Date:   Thu Jun 14 10:52:33 2018 -0400

    Fix minor leak in krb5_get_fallback_host_realm()
    
    In domain_fallback_realm(), if profile_get_integer() fails, uhost is
    leaked.  Fix this bug by using the cleanup handler instead of
    returning immediately.  Reported by Bean Zhang.
    
    ticket: 8693

 src/lib/krb5/os/hostrealm_domain.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lib/krb5/os/hostrealm_domain.c b/src/lib/krb5/os/hostrealm_domain.c
index 2228df0..c3d31c7 100644
--- a/src/lib/krb5/os/hostrealm_domain.c
+++ b/src/lib/krb5/os/hostrealm_domain.c
@@ -81,7 +81,7 @@ domain_fallback_realm(krb5_context context, krb5_hostrealm_moddata data,
     ret = profile_get_integer(context->profile, KRB5_CONF_LIBDEFAULTS,
                               KRB5_CONF_REALM_TRY_DOMAINS, 0, -1, &limit);
     if (ret)
-        return ret;
+        goto cleanup;
     suffix = uhost;
     while (limit-- >= 0 && (dot = strchr(suffix, '.')) != NULL) {
         drealm = string2data((char *)suffix);
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post