From: Ezra Peisach Date: Sun, 6 Mar 2011 13:29:54 +0000 (+0000) Subject: Clean up memory leaks at end of program. No leaks now on success X-Git-Tag: krb5-1.10-alpha1~548 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=779f6b94a549f2f433babfb576e59db75d2d7375;p=krb5.git 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 --- 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; }