From d8df7f32058effebcee72c729df6b33b59524742 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Thu, 19 Feb 2009 00:36:07 +0000 Subject: [PATCH] pull up r21901 from trunk ------------------------------------------------------------------------ r21901 | ghudson | 2009-02-05 16:27:54 -0500 (Thu, 05 Feb 2009) | 8 lines Changed paths: M /trunk/src/lib/krb5/krb/mk_req_ext.c ticket: 6372 subject: Fix memory handling bug in mk_req_ext tags: pullup target_version: 1.7 In make_etype_list, assign *authdata before we have a chance to fail, since we may have invalidated the previous value with realloc. ------------------------------------------------------------------------ ticket: 6372 version_fixed: 1.7 status: resolved git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-7@22027 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/mk_req_ext.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/krb5/krb/mk_req_ext.c b/src/lib/krb5/krb/mk_req_ext.c index 2d700aec8..ed23fef4b 100644 --- a/src/lib/krb5/krb/mk_req_ext.c +++ b/src/lib/krb5/krb/mk_req_ext.c @@ -391,6 +391,7 @@ make_etype_list(krb5_context context, krb5_free_data(context, ad_if_relevant); return ENOMEM; } + *authdata = adata; adata[i] = (krb5_authdata *)malloc(sizeof(krb5_authdata)); if (adata[i] == NULL) { @@ -405,8 +406,6 @@ make_etype_list(krb5_context context, adata[i + 1] = NULL; - *authdata = adata; - return 0; } -- 2.26.2