svn rev #22309: trunk/src/lib/krb5/krb/

ghudson@MIT.EDU ghudson at MIT.EDU
Tue May 5 12:00:41 EDT 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22309
Commit By: ghudson
Log Message:
Fix a case in the krb5_rd_rep error handler (introduced in the last
commit) where scratch.data could be indirected through even if it
wasn't allocated successfully.



Changed Files:
U   trunk/src/lib/krb5/krb/rd_rep.c
Modified: trunk/src/lib/krb5/krb/rd_rep.c
===================================================================
--- trunk/src/lib/krb5/krb/rd_rep.c	2009-05-04 19:43:36 UTC (rev 22308)
+++ trunk/src/lib/krb5/krb/rd_rep.c	2009-05-05 16:00:40 UTC (rev 22309)
@@ -145,10 +145,11 @@
     enc = NULL;
 
 clean_scratch:
-    memset(scratch.data, 0, scratch.length); 
+    if (scratch.data)
+	memset(scratch.data, 0, scratch.length); 
+    free(scratch.data);
     krb5_free_ap_rep(context, reply);
     krb5_free_ap_rep_enc_part(context, enc);
-    free(scratch.data);
     return retval;
 }
 




More information about the cvs-krb5 mailing list