From 940fe5c5a85b14b879f70a7eb8235448a0cd7c43 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Sun, 1 Nov 2009 14:13:32 +0000 Subject: [PATCH] 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 --- src/lib/krb5/krb/preauth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.26.2