From: Greg Hudson Date: Fri, 24 Jun 2011 20:12:24 +0000 (+0000) Subject: Use zapfree in krb5_free_key_data_contents() X-Git-Tag: krb5-1.10-alpha1~384 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e5ef18829c2ffe733d29fcaf74c05cc0196c2465;p=krb5.git Use zapfree in krb5_free_key_data_contents() git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24989 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kadm5/misc_free.c b/src/lib/kadm5/misc_free.c index 0f611cce6..4d38c0f99 100644 --- a/src/lib/kadm5/misc_free.c +++ b/src/lib/kadm5/misc_free.c @@ -3,6 +3,7 @@ * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved */ +#include "k5-int.h" #include #include #include "server_internal.h" @@ -36,12 +37,8 @@ kadm5_ret_t krb5_free_key_data_contents(context, key) int i, idx; idx = (key->key_data_ver == 1 ? 1 : 2); - for (i = 0; i < idx; i++) { - if (key->key_data_contents[i]) { - memset(key->key_data_contents[i], 0, key->key_data_length[i]); - free(key->key_data_contents[i]); - } - } + for (i = 0; i < idx; i++) + zapfree(key->key_data_contents[i], key->key_data_length[i]); return KADM5_OK; }