From: Greg Hudson Date: Sun, 1 Nov 2009 14:13:32 +0000 (+0000) Subject: Memory leak fix: in obtain_sam_padata, after claiming the contents of X-Git-Tag: krb5-1.8-alpha1~225 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=940fe5c5a85b14b879f70a7eb8235448a0cd7c43;p=krb5.git 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. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23114 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/preauth.c b/src/lib/krb5/krb/preauth.c index d9c076eef..3c62f6053 100644 --- a/src/lib/krb5/krb/preauth.c +++ b/src/lib/krb5/krb/preauth.c @@ -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;