From d1fb00973c32e51a9697f64c97d2d22c757b1f47 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 31 Jul 2002 23:50:02 +0000 Subject: [PATCH] * dump.c (master_key_convert): Iterate over freeing key_data->key_data_contents[j] rather than attempting to free key_data->key_data_contents. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14678 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/dbutil/ChangeLog | 6 ++++++ src/kadmin/dbutil/dump.c | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/kadmin/dbutil/ChangeLog b/src/kadmin/dbutil/ChangeLog index fc369c86c..1ea67317a 100644 --- a/src/kadmin/dbutil/ChangeLog +++ b/src/kadmin/dbutil/ChangeLog @@ -1,3 +1,9 @@ +2002-07-31 Tom Yu + + * dump.c (master_key_convert): Iterate over freeing + key_data->key_data_contents[j] rather than attempting to free + key_data->key_data_contents. + 2002-07-29 Jen Selby * kdb5_util.M: added documentation for some options. diff --git a/src/kadmin/dbutil/dump.c b/src/kadmin/dbutil/dump.c index b3198a8c1..3eff578d0 100644 --- a/src/kadmin/dbutil/dump.c +++ b/src/kadmin/dbutil/dump.c @@ -249,7 +249,7 @@ static krb5_error_code master_key_convert(context, db_entry) krb5_error_code retval; krb5_keyblock v5plainkey, *key_ptr; krb5_keysalt keysalt; - int i; + int i, j; krb5_key_data new_key_data, *key_data; krb5_boolean is_mkey; @@ -278,7 +278,11 @@ static krb5_error_code master_key_convert(context, db_entry) if (retval) return retval; krb5_free_keyblock_contents(context, &v5plainkey); - free(key_data->key_data_contents); + for (j = 0; j < key_data->key_data_ver; j++) { + if (key_data->key_data_length[j]) { + free(key_data->key_data_contents[j]); + } + } *key_data = new_key_data; } return 0; -- 2.26.2