diff options
author | Ezra Peisach <epeisach@mit.edu> | 2009-11-22 04:26:48 +0000 |
---|---|---|
committer | Ezra Peisach <epeisach@mit.edu> | 2009-11-22 04:26:48 +0000 |
commit | fe4fa8cdcae6d7e2668cc2678ba8d1ff8b0000cb (patch) | |
tree | 0dcf189f62d707f1042a92040773c797b10b29c6 /src/lib/kadm5 | |
parent | dd5fca3fee8557084fa4d579f5961c3047889663 (diff) | |
download | krb5-fe4fa8cdcae6d7e2668cc2678ba8d1ff8b0000cb.zip krb5-fe4fa8cdcae6d7e2668cc2678ba8d1ff8b0000cb.tar.gz krb5-fe4fa8cdcae6d7e2668cc2678ba8d1ff8b0000cb.tar.bz2 |
Clean up some memory leaks by releasing context
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23299 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/kadm5')
-rw-r--r-- | src/lib/kadm5/unit-test/destroy-test.c | 1 | ||||
-rw-r--r-- | src/lib/kadm5/unit-test/init-test.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/kadm5/unit-test/destroy-test.c b/src/lib/kadm5/unit-test/destroy-test.c index b12d42f..ccca249 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 a7f065d..354b812 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); } } |