In kadmin, free the correct item in an error case (fixes a double-free
authorGreg Hudson <ghudson@mit.edu>
Fri, 23 Jan 2009 17:24:50 +0000 (17:24 +0000)
committerGreg Hudson <ghudson@mit.edu>
Fri, 23 Jan 2009 17:24:50 +0000 (17:24 +0000)
and a memory leak).

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21783 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/cli/kadmin.c

index b2bda154592620c0c8be4a269bbf326ba8e9053d..469deaa77121b4976225a652efd7dd4992a104bb 100644 (file)
@@ -1486,7 +1486,7 @@ void kadmin_getprinc(argc, argv)
     retval = krb5_unparse_name(context, dprinc.principal, &canon);
     if (retval) {
        com_err("get_principal", retval, "while canonicalizing principal");
-       krb5_free_principal(context, princ);
+       kadm5_free_principal_ent(handle, &dprinc);
        return;
     }
     retval = krb5_unparse_name(context, dprinc.mod_name, &modcanon);