From 779f6b94a549f2f433babfb576e59db75d2d7375 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Sun, 6 Mar 2011 13:29:54 +0000 Subject: [PATCH] Clean up memory leaks at end of program. No leaks now on success git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24688 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/user_user/client.c | 12 ++++++++++++ src/appl/user_user/server.c | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/src/appl/user_user/client.c b/src/appl/user_user/client.c index 39bd188e2..891eb9f46 100644 --- a/src/appl/user_user/client.c +++ b/src/appl/user_user/client.c @@ -278,5 +278,17 @@ int main (int argc, char *argv[]) } printf ("uu-client: server says \"%s\".\n", msg.data); + + + krb5_free_ticket(context, ticket); + krb5_free_host_realm(context, srealms); + free(hname); + krb5_free_cred_contents(context, &creds); + krb5_free_creds(context, new_creds); + krb5_free_data_contents(context, &msg); + krb5_free_data_contents(context, &reply); + krb5_cc_close(context, cc); + krb5_auth_con_free(context, auth_context); + krb5_free_context(context); return 0; } diff --git a/src/appl/user_user/server.c b/src/appl/user_user/server.c index b3cfcc163..299c2ac7a 100644 --- a/src/appl/user_user/server.c +++ b/src/appl/user_user/server.c @@ -238,5 +238,14 @@ int main(argc, argv) return 7; } + + krb5_free_data_contents(context, &msg); + krb5_free_data_contents(context, &pname_data); + /* tkt_data freed with creds */ + krb5_free_cred_contents(context, &creds); + krb5_free_creds(context, new_creds); + krb5_cc_close(context, cc); + krb5_auth_con_free(context, auth_context); + krb5_free_context(context); return 0; } -- 2.26.2