diff options
author | Ezra Peisach <epeisach@mit.edu> | 2001-11-19 18:41:24 +0000 |
---|---|---|
committer | Ezra Peisach <epeisach@mit.edu> | 2001-11-19 18:41:24 +0000 |
commit | 25b3725bd3ba37dd869e5484cb44d0434db24289 (patch) | |
tree | a273118c73412fa705cef75b6d45d0ca1eb656ac | |
parent | 69892375d8bd25d12d0418d2d941ecc74ce46019 (diff) | |
download | krb5-25b3725bd3ba37dd869e5484cb44d0434db24289.tar.gz krb5-25b3725bd3ba37dd869e5484cb44d0434db24289.tar.xz krb5-25b3725bd3ba37dd869e5484cb44d0434db24289.zip |
* kdb5_verify.c (main): Use krb5_free_unparsed_name() to free up
memory.
(check_princ): Use krb5_free_data_contents() and
krb5_free_principal() to cleanup memory leak.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13996 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/tests/verify/ChangeLog | 7 | ||||
-rw-r--r-- | src/tests/verify/kdb5_verify.c | 11 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/tests/verify/ChangeLog b/src/tests/verify/ChangeLog index c12b37dc0d..39c3982c21 100644 --- a/src/tests/verify/ChangeLog +++ b/src/tests/verify/ChangeLog @@ -1,3 +1,10 @@ +2001-11-19 Ezra Peisach <epeisach@mit.edu> + + * kdb5_verify.c (main): Use krb5_free_unparsed_name() to free up + memory. + (check_princ): Use krb5_free_data_contents() and + krb5_free_principal() to cleanup memory leak. + 2001-10-09 Ken Raeburn <raeburn@mit.edu> * kdb5_verify.c: Make prototypes unconditional. diff --git a/src/tests/verify/kdb5_verify.c b/src/tests/verify/kdb5_verify.c index f15abaa5e6..1127c7fda0 100644 --- a/src/tests/verify/kdb5_verify.c +++ b/src/tests/verify/kdb5_verify.c @@ -209,6 +209,11 @@ char *argv[]; com_err(progname, retval, "while closing database"); exit(1); } + + if (str_master_princ) { + krb5_free_unparsed_name(context, str_master_princ); + } + krb5_free_context(context); exit(0); } @@ -241,6 +246,7 @@ check_princ(context, str_princ) if ((retval = krb5_principal2salt(context, princ, &salt))) { com_err(progname, retval, "while converting principal to salt for '%s'", princ_name); + krb5_free_principal(context, princ); goto out; } @@ -248,14 +254,19 @@ check_princ(context, str_princ) &pwd_key, &pwd, &salt))) { com_err(progname, retval, "while converting password to key for '%s'", princ_name); + krb5_free_data_contents(context, &salt); + krb5_free_principal(context, princ); goto out; } + krb5_free_data_contents(context, &salt); if ((retval = krb5_db_get_principal(context, princ, &kdbe, &nprincs, &more))) { com_err(progname, retval, "while attempting to verify principal's existence"); + krb5_free_principal(context, princ); goto out; } + krb5_free_principal(context, princ); if (nprincs != 1) { com_err(progname, 0, "Found %d entries db entry for %s.\n", nprincs, |