From 4ab2266afad7a3ede0fa3587d7a38e855948af55 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Thu, 30 Jul 2009 17:22:28 +0000 Subject: [PATCH] Fix memory leak in k5_pac_verify_server_checksum k5_pac_verify_server_checksum was leaking memory when the checksum was valid. t_pac.c: Fix memory leak by forgetting to release memory. ticket: 6541 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22474 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/pac.c | 4 +++- src/lib/krb5/krb/t_pac.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/krb/pac.c b/src/lib/krb5/krb/pac.c index 30a63bf35..c5a706562 100644 --- a/src/lib/krb5/krb/pac.c +++ b/src/lib/krb5/krb/pac.c @@ -547,8 +547,10 @@ k5_pac_verify_server_checksum(krb5_context context, ret = krb5_c_verify_checksum(context, server, KRB5_KEYUSAGE_APP_DATA_CKSUM, &pac_data, &checksum, &valid); + + free(pac_data.data); + if (ret != 0) { - free(pac_data.data); return ret; } diff --git a/src/lib/krb5/krb/t_pac.c b/src/lib/krb5/krb/t_pac.c index 527e3db22..503d778a9 100644 --- a/src/lib/krb5/krb/t_pac.c +++ b/src/lib/krb5/krb/t_pac.c @@ -220,6 +220,8 @@ main(int argc, char **argv) if (ret) err(context, ret, "krb5_pac_verify 4"); + krb5_free_data_contents(context, &data); + krb5_pac_free(context, pac2); } -- 2.26.2