summaryrefslogtreecommitdiff
path: root/usr.sbin/unbound/util/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/unbound/util/module.c')
-rw-r--r--usr.sbin/unbound/util/module.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/unbound/util/module.c b/usr.sbin/unbound/util/module.c
index 62e5de4a05b..90a155b5e8a 100644
--- a/usr.sbin/unbound/util/module.c
+++ b/usr.sbin/unbound/util/module.c
@@ -129,7 +129,7 @@ void errinf_origin(struct module_qstate* qstate, struct sock_list *origin)
}
}
-char* errinf_to_str_bogus(struct module_qstate* qstate)
+char* errinf_to_str_bogus(struct module_qstate* qstate, struct regional* region)
{
char buf[20480];
char* p = buf;
@@ -148,7 +148,10 @@ char* errinf_to_str_bogus(struct module_qstate* qstate)
snprintf(p, left, " %s", s->str);
left -= strlen(p); p += strlen(p);
}
- p = strdup(buf);
+ if(region)
+ p = regional_strdup(region, buf);
+ else
+ p = strdup(buf);
if(!p)
log_err("malloc failure in errinf_to_str");
return p;
@@ -188,7 +191,7 @@ char* errinf_to_str_servfail(struct module_qstate* qstate)
snprintf(p, left, " %s", s->str);
left -= strlen(p); p += strlen(p);
}
- p = strdup(buf);
+ p = regional_strdup(qstate->region, buf);
if(!p)
log_err("malloc failure in errinf_to_str");
return p;
@@ -206,7 +209,7 @@ char* errinf_to_str_misc(struct module_qstate* qstate)
snprintf(p, left, "%s%s", (s==qstate->errinf?"":" "), s->str);
left -= strlen(p); p += strlen(p);
}
- p = strdup(buf);
+ p = regional_strdup(qstate->region, buf);
if(!p)
log_err("malloc failure in errinf_to_str");
return p;