From 89b1c35d3a548d9054305ebebc59592b99410673 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Wed, 20 Feb 1991 12:14:47 +0000 Subject: [PATCH] plug some memory leaks git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1734 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/do_as_req.c | 5 +++++ src/kdc/do_tgs_req.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/kdc/do_as_req.c b/src/kdc/do_as_req.c index 7215c3559..a5d59b428 100644 --- a/src/kdc/do_as_req.c +++ b/src/kdc/do_as_req.c @@ -358,6 +358,11 @@ krb5_data **response; /* filled in with a response packet */ memset((char *)encrypting_key.contents, 0, encrypting_key.length); xfree(encrypting_key.contents); cleanup(); + /* these parts are left on as a courtesy from krb5_encode_kdc_rep so we + can use them in raw form if needed. But, we don't... */ + memset(reply.enc_part.ciphertext.data, 0, + reply.enc_part.ciphertext.length); + free(reply.enc_part.ciphertext.data); return retval; } diff --git a/src/kdc/do_tgs_req.c b/src/kdc/do_tgs_req.c index 57e790903..66d3b91fc 100644 --- a/src/kdc/do_tgs_req.c +++ b/src/kdc/do_tgs_req.c @@ -528,6 +528,14 @@ tgt_again: xfree(session_key->contents); tkt_cleanup(); session_key->contents = 0; + memset(ticket_reply.enc_part.ciphertext.data, 0, + ticket_reply.enc_part.ciphertext.length); + free(ticket_reply.enc_part.ciphertext.data); + /* these parts are left on as a courtesy from krb5_encode_kdc_rep so we + can use them in raw form if needed. But, we don't... */ + memset(reply.enc_part.ciphertext.data, 0, + reply.enc_part.ciphertext.length); + free(reply.enc_part.ciphertext.data); return retval; } -- 2.26.2