summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Kohl <jtkohl@mit.edu>1990-05-03 18:31:14 +0000
committerJohn Kohl <jtkohl@mit.edu>1990-05-03 18:31:14 +0000
commit6972a06d6c1773d61601231295641d9564e660f3 (patch)
tree395985cc9f7a38f66131e6b5488fd8c0b64ec288 /src
parent8e11b5f97d11818fef4269641facc16fd37cd885 (diff)
downloadkrb5-6972a06d6c1773d61601231295641d9564e660f3.tar.gz
krb5-6972a06d6c1773d61601231295641d9564e660f3.tar.xz
krb5-6972a06d6c1773d61601231295641d9564e660f3.zip
fix some confusion about when to release data
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@714 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/lib/krb5/krb/mk_req_ext.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/krb5/krb/mk_req_ext.c b/src/lib/krb5/krb/mk_req_ext.c
index bbfc4b2e0..3108e7611 100644
--- a/src/lib/krb5/krb/mk_req_ext.c
+++ b/src/lib/krb5/krb/mk_req_ext.c
@@ -76,6 +76,7 @@ krb5_data *outbuf;
krb5_data *scratch;
krb5_enctype etype;
krb5_encrypt_block eblock;
+ krb5_data *toutbuf;
if ((ap_req_options & AP_OPTS_USE_SESSION_KEY) &&
!creds->ticket.length)
@@ -110,9 +111,10 @@ krb5_data *outbuf;
}
/* encode it before encrypting */
retval = encode_krb5_authenticator(&authent, &scratch);
- cleanup_ticket();
- if (retval)
+ if (retval) {
+ cleanup_ticket();
return(retval);
+ }
#define cleanup_scratch() { (void) bzero(scratch->data, scratch->length); krb5_free_data(scratch); }
@@ -152,10 +154,13 @@ krb5_data *outbuf;
return retval;
}
- retval = encode_krb5_ap_req(&request, &outbuf);
+ if (!(retval = encode_krb5_ap_req(&request, &toutbuf))) {
+ *outbuf = *toutbuf;
+ xfree(toutbuf);
+ }
+ cleanup_ticket();
cleanup_encpart();
- if (retval)
- return(retval);
+ return retval;
clean_prockey:
cleanup_prockey();