From: Artem Egorenkov Date: Fri, 6 Aug 2021 12:03:23 +0000 (+0200) Subject: - memory management violations fixed X-Git-Tag: release-1.14.0rc1~7^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F522%2Fhead;p=thirdparty%2Funbound.git - memory management violations fixed --- diff --git a/dns64/dns64.c b/dns64/dns64.c index c79bc9c65..860b3a728 100644 --- a/dns64/dns64.c +++ b/dns64/dns64.c @@ -685,8 +685,12 @@ dns64_operate(struct module_qstate* qstate, enum module_ev event, int id, switch(event) { case module_event_new: /* Tag this query as being new and fall through. */ - iq = (struct dns64_qstate*)regional_alloc( - qstate->region, sizeof(*iq)); + if (!(iq = (struct dns64_qstate*)regional_alloc( + qstate->region, sizeof(*iq)))) { + log_err("out of memory"); + qstate->ext_state[id] = module_error; + return; + } qstate->minfo[id] = iq; iq->state = DNS64_NEW_QUERY; iq->started_no_cache_store = qstate->no_cache_store; diff --git a/util/net_help.c b/util/net_help.c index 06bc1f5dd..5788ac87e 100644 --- a/util/net_help.c +++ b/util/net_help.c @@ -1172,6 +1172,7 @@ void* connect_sslctx_create(char* key, char* pem, char* verifypem, int wincert) if((SSL_CTX_set_options(ctx, SSL_OP_NO_RENEGOTIATION) & SSL_OP_NO_RENEGOTIATION) != SSL_OP_NO_RENEGOTIATION) { log_crypto_err("could not set SSL_OP_NO_RENEGOTIATION"); + SSL_CTX_free(ctx); return 0; } #endif