From 91cce60b4c05c07b8555f79905535887cbf7aaf2 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Mon, 24 May 2004 19:53:16 +0000 Subject: [PATCH] * t_cc.c (cc_test): Clean up memory leaks in tests git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16355 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/ccache/ChangeLog | 4 ++++ src/lib/krb5/ccache/t_cc.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/lib/krb5/ccache/ChangeLog b/src/lib/krb5/ccache/ChangeLog index 6d469a50a..d4dd3be9e 100644 --- a/src/lib/krb5/ccache/ChangeLog +++ b/src/lib/krb5/ccache/ChangeLog @@ -1,3 +1,7 @@ +2004-05-24 Ezra Peisach + + * t_cc.c (cc_test): Clean up memory leaks in tests. + 2004-05-15 Jeffrey Altman * cc_mslsa.c: The FAILED() macro only considered an error diff --git a/src/lib/krb5/ccache/t_cc.c b/src/lib/krb5/ccache/t_cc.c index 30d5e7d4b..b978abf09 100644 --- a/src/lib/krb5/ccache/t_cc.c +++ b/src/lib/krb5/ccache/t_cc.c @@ -90,6 +90,14 @@ static void init_test_cred(krb5_context context) "server-comp1", "server-comp2", 0); } +static void free_test_cred(krb5_context context) +{ + krb5_free_principal(context, test_creds.client); + + krb5_free_principal(context, test_creds.server); + +} + #define CHECK(kret,msg) \ if (kret != KRB5_OK) {\ com_err(msg, kret, ""); \ @@ -193,6 +201,9 @@ static void cc_test(krb5_context context, const char *name, int flags) kret = krb5_cc_destroy(context, id); CHECK(kret, "destroy"); #endif + + free_test_cred(context); + } static void do_test(krb5_context context, const char *prefix) -- 2.26.2