From: Mark Andrews Date: Thu, 9 Dec 2010 04:12:15 +0000 (+0000) Subject: always free dstkey now that it is being reference counted X-Git-Tag: v4_2_1b1~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1128848d40a624a0218d4e48179a6eb1b7afda66;p=thirdparty%2Fdhcp.git always free dstkey now that it is being reference counted --- diff --git a/omapip/auth.c b/omapip/auth.c index a9a0a850a..ab00b2808 100644 --- a/omapip/auth.c +++ b/omapip/auth.c @@ -115,13 +115,10 @@ isc_result_t omapi_auth_key_enter (omapi_auth_key_t *a) if (status == ISC_R_SUCCESS) { status = dns_tsec_create(dhcp_gbl_ctx.mctx, dns_tsectype_tsig, dstkey, &a->tsec_key); + dst_key_free(&dstkey); } - if (status != ISC_R_SUCCESS) { - if (dstkey != NULL) { - dst_key_free(&dstkey); - } + if (status != ISC_R_SUCCESS) log_error("Unable to create tsec structure for %s", a->name); - } omapi_auth_key_hash_add (auth_key_hash, a -> name, 0, a, MDL); return ISC_R_SUCCESS;