unbound/unbound-1.13.1-rh1977401.patch
Artem Egorenkov 7f41dcdd3a Fixed error in the patch
Resolves: rhbz#1977401
2022-02-11 16:17:18 +01:00

20 lines
695 B
Diff

diff --git a/dns64/dns64.c b/dns64/dns64.c
index c79bc9c..fddbc62 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;