Memory leak fix: in obtain_sam_padata, after claiming the contents of
authorGreg Hudson <ghudson@mit.edu>
Sun, 1 Nov 2009 14:13:32 +0000 (14:13 +0000)
committerGreg Hudson <ghudson@mit.edu>
Sun, 1 Nov 2009 14:13:32 +0000 (14:13 +0000)
the scratch data object, free the outer structure before nulling the
pointer to it.

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

src/lib/krb5/krb/preauth.c

index d9c076eef57c9671ccf4aa980c587fb542f99bc5..3c62f605374b534d7a107dfbcb3e36b4283d1c3c 100644 (file)
@@ -562,7 +562,8 @@ obtain_sam_padata(krb5_context context, krb5_pa_data *in_padata, krb5_etype_info
     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;