Reposition a trace call which was dereferencing freed memory after
authorGreg Hudson <ghudson@mit.edu>
Sun, 13 Feb 2011 18:48:06 +0000 (18:48 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sun, 13 Feb 2011 18:48:06 +0000 (18:48 +0000)
r24616.

ticket: 6855

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

src/lib/krb5/krb/rd_req_dec.c

index e065e2157f853a4fe47569c3aea09653e058935e..80d5cc50f16df9a73d13c0ed9b90f32c8a3b0363 100644 (file)
@@ -146,11 +146,12 @@ try_one_princ(krb5_context context, const krb5_ap_req *req,
     if (ret)
         return ret;
     ret = try_one_entry(context, req, &ent, keyblock_out);
+    if (ret == 0)
+        TRACE_RD_REQ_DECRYPT_SPECIFIC(context, ent.principal, &ent.key);
     (void)krb5_free_keytab_entry_contents(context, &ent);
     if (ret)
         return ret;
 
-    TRACE_RD_REQ_DECRYPT_SPECIFIC(context, ent.principal, &ent.key);
     return 0;
 }