From 19ad7cbf0d79d392765fc6ef7977256785831cc3 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Mon, 24 May 2004 19:33:33 +0000 Subject: [PATCH] * kdb5_mkdums.c (main): Fix memory leak of master principal at exit git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16352 dc483132-0cff-0310-8789-dd5450dbe970 --- src/tests/create/ChangeLog | 4 ++++ src/tests/create/kdb5_mkdums.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/tests/create/ChangeLog b/src/tests/create/ChangeLog index 001b6b1f4..8d2b01aa6 100644 --- a/src/tests/create/ChangeLog +++ b/src/tests/create/ChangeLog @@ -1,3 +1,7 @@ +2004-05-24 Ezra Peisach + + * kdb5_mkdums.c (main): Fix memory leak of master principal at exit. + 2003-05-22 Ezra Peisach * kdb5_mkdums.c (main): When attempting to register writable diff --git a/src/tests/create/kdb5_mkdums.c b/src/tests/create/kdb5_mkdums.c index 4a1f0e94f..024664c80 100644 --- a/src/tests/create/kdb5_mkdums.c +++ b/src/tests/create/kdb5_mkdums.c @@ -65,6 +65,7 @@ int status; exit(status); } +int master_princ_set = 0; krb5_keyblock master_keyblock; krb5_principal master_princ; krb5_db_entry master_entry; @@ -205,6 +206,9 @@ main(argc, argv) com_err(progname, retval, "while closing database"); exit(1); } + if (master_princ_set) { + krb5_free_principal(test_context, master_princ); + } krb5_free_context(test_context); exit(0); } @@ -345,6 +349,7 @@ char *dbname; com_err(pname, retval, "while setting up master key name"); return(1); } + master_princ_set = 1; if (mkey_password) { pwd.data = mkey_password; pwd.length = strlen(mkey_password); -- 2.26.2