mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 09:32:08 -04:00
Fix cleanup of signature buffer in dns_dnssec_signmessage
A NULL pointer could be freed if error handling occured.
This commit is contained in:
parent
e112afa156
commit
0378c05ba0
1 changed files with 1 additions and 3 deletions
|
|
@ -943,7 +943,6 @@ dns_dnssec_signmessage(dns_message_t *msg, dst_key_t *key) {
|
|||
dst_context_t *ctx = NULL;
|
||||
isc_mem_t *mctx;
|
||||
isc_result_t result;
|
||||
bool signeedsfree = true;
|
||||
|
||||
REQUIRE(msg != NULL);
|
||||
REQUIRE(key != NULL);
|
||||
|
|
@ -1032,7 +1031,6 @@ dns_dnssec_signmessage(dns_message_t *msg, dst_key_t *key) {
|
|||
dynbuf));
|
||||
|
||||
isc_mem_put(mctx, sig.signature, sig.siglen);
|
||||
signeedsfree = false;
|
||||
|
||||
dns_message_takebuffer(msg, &dynbuf);
|
||||
|
||||
|
|
@ -1053,7 +1051,7 @@ failure:
|
|||
if (dynbuf != NULL) {
|
||||
isc_buffer_free(&dynbuf);
|
||||
}
|
||||
if (signeedsfree) {
|
||||
if (sig.signature != NULL) {
|
||||
isc_mem_put(mctx, sig.signature, sig.siglen);
|
||||
}
|
||||
if (ctx != NULL) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue