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

ghudson@MIT.EDU ghudson at MIT.EDU
Sun Nov 1 09:13:32 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=23114
Commit By: ghudson
Log Message:
Memory leak fix: in obtain_sam_padata, after claiming the contents of
the scratch data object, free the outer structure before nulling the
pointer to it.



Changed Files:
U   trunk/src/lib/krb5/krb/preauth.c
Modified: trunk/src/lib/krb5/krb/preauth.c
===================================================================
--- trunk/src/lib/krb5/krb/preauth.c	2009-11-01 04:35:20 UTC (rev 23113)
+++ trunk/src/lib/krb5/krb/preauth.c	2009-11-01 14:13:32 UTC (rev 23114)
@@ -562,7 +562,8 @@
     pa->pa_type = KRB5_PADATA_SAM_RESPONSE;
     pa->length = scratch->length;
     pa->contents = (krb5_octet *) scratch->data;
-    scratch = 0;		/* so we don't free it! */
+    free(scratch);
+    scratch = NULL;
 
     *out_padata = pa;
 




More information about the cvs-krb5 mailing list