From edddcccb6dbad4254d174d2ab456bf3c62ee42af Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Thu, 14 Aug 2008 16:22:48 +0000 Subject: [PATCH] Clean up memory leak in krb5_build_principal if we run out of memory while building pricipal. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20656 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/bld_princ.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/krb5/krb/bld_princ.c b/src/lib/krb5/krb/bld_princ.c index c6cb7af05..03bf1267e 100644 --- a/src/lib/krb5/krb/bld_princ.c +++ b/src/lib/krb5/krb/bld_princ.c @@ -106,5 +106,8 @@ krb5_build_principal(krb5_context context, krb5_principal * princ, va_end(ap); if (retval == 0) *princ = pr_ret; + else + krb5_xfree(pr_ret); + return retval; } -- 2.26.2