2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 21:47:59 +00:00

dns_key_free seg fault

This commit is contained in:
Brian Wellington 1999-08-03 19:48:10 +00:00
parent 1afdc8c2e7
commit ebe3937fc0

View File

@ -17,7 +17,7 @@
/* /*
* Principal Author: Brian Wellington * Principal Author: Brian Wellington
* $Id: dst_api.c,v 1.2 1999/07/29 17:21:23 bwelling Exp $ * $Id: dst_api.c,v 1.3 1999/08/03 19:48:10 bwelling Exp $
*/ */
#include <config.h> #include <config.h>
@ -529,15 +529,19 @@ dst_key_compare(const dst_key_t *key1, const dst_key_t *key2) {
*/ */
void void
dst_key_free(dst_key_t *key) { dst_key_free(dst_key_t *key) {
isc_mem_t *mctx;
RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS); RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
REQUIRE(VALID_KEY(key)); REQUIRE(VALID_KEY(key));
if (key->opaque != NULL) mctx = key->mctx;
key->func->destroy(key->opaque, key->mctx);
isc_mem_free(key->mctx, key->key_name); if (key->opaque != NULL)
key->func->destroy(key->opaque, mctx);
isc_mem_free(mctx, key->key_name);
memset(key, 0, sizeof(dst_key_t)); memset(key, 0, sizeof(dst_key_t));
isc_mem_put(key->mctx, key, sizeof(dst_key_t)); isc_mem_put(mctx, key, sizeof(dst_key_t));
} }
char * char *