From e5ef18829c2ffe733d29fcaf74c05cc0196c2465 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Fri, 24 Jun 2011 20:12:24 +0000 Subject: [PATCH] Use zapfree in krb5_free_key_data_contents() git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24989 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kadm5/misc_free.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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; } -- 2.26.2