mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Handle memory allocation failure in make_non_terminals()
Thanks to Kristian Evensen for spotting the problem.
This commit is contained in:
@@ -1434,6 +1434,8 @@ static void make_non_terminals(struct crec *source)
|
|||||||
#endif
|
#endif
|
||||||
crecp = whine_malloc(sizeof(struct crec));
|
crecp = whine_malloc(sizeof(struct crec));
|
||||||
|
|
||||||
|
if (crecp)
|
||||||
|
{
|
||||||
*crecp = *source;
|
*crecp = *source;
|
||||||
crecp->flags &= ~(F_IPV4 | F_IPV6 | F_CNAME | F_DNSKEY | F_DS | F_REVERSE);
|
crecp->flags &= ~(F_IPV4 | F_IPV6 | F_CNAME | F_DNSKEY | F_DS | F_REVERSE);
|
||||||
crecp->flags |= F_NAMEP;
|
crecp->flags |= F_NAMEP;
|
||||||
@@ -1442,6 +1444,7 @@ static void make_non_terminals(struct crec *source)
|
|||||||
cache_hash(crecp);
|
cache_hash(crecp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef NO_ID
|
#ifndef NO_ID
|
||||||
int cache_make_stat(struct txt_record *t)
|
int cache_make_stat(struct txt_record *t)
|
||||||
|
|||||||
Reference in New Issue
Block a user