diff options
author | Greg Hudson <ghudson@mit.edu> | 2009-02-05 21:27:54 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2009-02-05 21:27:54 +0000 |
commit | 29e1221373f5547c8a46f1e809e94b96bbca69d6 (patch) | |
tree | 3cc9e163894296af94e3b9772b2954fea4e9fb50 /src | |
parent | 3442622bf0e205fa829520868909a8b8d0771e9f (diff) | |
download | krb5-29e1221373f5547c8a46f1e809e94b96bbca69d6.tar.gz krb5-29e1221373f5547c8a46f1e809e94b96bbca69d6.tar.xz krb5-29e1221373f5547c8a46f1e809e94b96bbca69d6.zip |
Fix memory handling bug in mk_req_ext
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
tags: pullup
target_version: 1.7
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@21901 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/krb5/krb/mk_req_ext.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/krb5/krb/mk_req_ext.c b/src/lib/krb5/krb/mk_req_ext.c index 2d700aec89..ed23fef4b7 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; } |