Clean up memory leak in krb5_build_principal if we run out of memory
authorEzra Peisach <epeisach@mit.edu>
Thu, 14 Aug 2008 16:22:48 +0000 (16:22 +0000)
committerEzra Peisach <epeisach@mit.edu>
Thu, 14 Aug 2008 16:22:48 +0000 (16:22 +0000)
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

index c6cb7af058e81b55b05f6ea684a49f6dab980475..03bf1267e3824a88cff7cad63abbe2b428e304cd 100644 (file)
@@ -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;
 }