From f6d17bbc5c9b207f7b1c726ebe344fffdaeca32b Mon Sep 17 00:00:00 2001 From: John Kohl Date: Wed, 20 Feb 1991 18:15:29 +0000 Subject: [PATCH] plug memory leak git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1746 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/file/fcc_retrv.c | 5 +++-- src/lib/krb5/ccache/file/fcc_skip.c | 5 +++-- src/lib/krb5/krb/send_tgs.c | 4 ++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/ccache/file/fcc_retrv.c b/src/lib/krb5/ccache/file/fcc_retrv.c index 69c36c125..d83478ccd 100644 --- a/src/lib/krb5/ccache/file/fcc_retrv.c +++ b/src/lib/krb5/ccache/file/fcc_retrv.c @@ -2,7 +2,8 @@ * $Source$ * $Author$ * - * Copyright 1990 by the Massachusetts Institute of Technology. + * Copyright 1990,1991 by the Massachusetts Institute of Technology. + * All Rights Reserved. * * For copying and distribution information, please see the file * . @@ -102,7 +103,7 @@ krb5_fcc_retrieve(id, whichfields, mcreds, creds) } /* This one doesn't match */ - /* XXX krb5_free_credentials(creds); */ + krb5_free_cred_contents(&fetchcreds); } /* If we get here, a match wasn't found */ diff --git a/src/lib/krb5/ccache/file/fcc_skip.c b/src/lib/krb5/ccache/file/fcc_skip.c index e2fe6410e..d21501aeb 100644 --- a/src/lib/krb5/ccache/file/fcc_skip.c +++ b/src/lib/krb5/ccache/file/fcc_skip.c @@ -2,7 +2,8 @@ * $Source$ * $Author$ * - * Copyright 1990 by the Massachusetts Institute of Technology. + * Copyright 1990,1991 by the Massachusetts Institute of Technology. + * All Rights Reserved. * * For copying and distribution information, please see the file * . @@ -29,7 +30,7 @@ krb5_fcc_skip_principal(id) if (kret != KRB5_OK) return kret; - /* XXX krb5_destroy_principal(&princ); */ + krb5_free_principal(princ); return KRB5_OK; } diff --git a/src/lib/krb5/krb/send_tgs.c b/src/lib/krb5/krb/send_tgs.c index 164c677de..40ae7f435 100644 --- a/src/lib/krb5/krb/send_tgs.c +++ b/src/lib/krb5/krb/send_tgs.c @@ -229,6 +229,7 @@ OLDDECLARG(krb5_response *,rep) if (!combined_padata) { cleanup(); cleanup_authdata(); + xfree(ap_req_padata.contents); return ENOMEM; } combined_padata[0] = &ap_req_padata; @@ -240,6 +241,7 @@ OLDDECLARG(krb5_response *,rep) if (!combined_padata) { cleanup(); cleanup_authdata(); + xfree(ap_req_padata.contents); return ENOMEM; } combined_padata[0] = &ap_req_padata; @@ -252,12 +254,14 @@ OLDDECLARG(krb5_response *,rep) cleanup(); cleanup_authdata(); xfree(combined_padata); + xfree(ap_req_padata.contents); return(retval); } if (sec_ticket) krb5_free_ticket(sec_ticket); cleanup_authdata(); xfree(combined_padata); + xfree(ap_req_padata.contents); #undef cleanup_authdata #undef cleanup #define cleanup() {xfree(ap_checksum.contents);} -- 2.26.2