From: Tom Yu Date: Wed, 31 Jul 2002 23:50:02 +0000 (+0000) Subject: * dump.c (master_key_convert): Iterate over freeing X-Git-Tag: krb5-1.3-alpha1~541 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d1fb00973c32e51a9697f64c97d2d22c757b1f47;p=krb5.git * 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 --- 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;