From fe4fa8cdcae6d7e2668cc2678ba8d1ff8b0000cb Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Sun, 22 Nov 2009 04:26:48 +0000 Subject: [PATCH] Clean up some memory leaks by releasing context git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23299 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kadm5/unit-test/destroy-test.c | 1 + src/lib/kadm5/unit-test/init-test.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/kadm5/unit-test/destroy-test.c b/src/lib/kadm5/unit-test/destroy-test.c index b12d42fa6..ccca24928 100644 --- a/src/lib/kadm5/unit-test/destroy-test.c +++ b/src/lib/kadm5/unit-test/destroy-test.c @@ -43,5 +43,6 @@ int main() } free(cp); } + krb5_free_context(context); exit(0); } diff --git a/src/lib/kadm5/unit-test/init-test.c b/src/lib/kadm5/unit-test/init-test.c index a7f065db5..354b812b6 100644 --- a/src/lib/kadm5/unit-test/init-test.c +++ b/src/lib/kadm5/unit-test/init-test.c @@ -23,14 +23,17 @@ int main() ret = kadm5_init(context, "admin", "admin", NULL, ¶ms, KADM5_STRUCT_VERSION, KADM5_API_VERSION_3, NULL, &server_handle); - if (ret == KADM5_RPC_ERROR) + if (ret == KADM5_RPC_ERROR) { + krb5_free_context(context); exit(0); + } else if (ret != 0) { com_err("init-test", ret, "while initializing without auth"); exit(1); } else { fprintf(stderr, "Unexpected success while initializing without auth!\n"); (void) kadm5_destroy(server_handle); + krb5_free_context(context); exit(1); } } -- 2.26.2