mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-08-17 21:25:50 +02:00
differentiate between malloc and regional_alloc
This commit is contained in:
+11
-3
@@ -673,6 +673,9 @@ void
|
||||
reply_info_delete(void* d, void* ATTR_UNUSED(arg))
|
||||
{
|
||||
struct reply_info* r = (struct reply_info*)d;
|
||||
if (r->reason_bogus_str_size) {
|
||||
free(r->reason_bogus_str);
|
||||
}
|
||||
free(r);
|
||||
}
|
||||
|
||||
@@ -761,9 +764,14 @@ reply_info_copy(struct reply_info* rep, struct alloc_cache* alloc,
|
||||
if(!cp)
|
||||
return NULL;
|
||||
|
||||
if (rep->reason_bogus_str_size > 0 && rep->reason_bogus_str && region) {
|
||||
cp->reason_bogus_str = (char*)regional_alloc(region,
|
||||
sizeof(char) * (rep->reason_bogus_str_size + 1));
|
||||
if (rep->reason_bogus_str_size > 0 && rep->reason_bogus_str) {
|
||||
if (region) {
|
||||
cp->reason_bogus_str = (char*)regional_alloc(region,
|
||||
sizeof(char) * (rep->reason_bogus_str_size + 1));
|
||||
}
|
||||
else {
|
||||
cp->reason_bogus_str = malloc(sizeof(char) * (rep->reason_bogus_str_size + 1));
|
||||
}
|
||||
|
||||
if (!(cp->reason_bogus_str)) {
|
||||
if(!region)
|
||||
|
||||
Reference in New Issue
Block a user