mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Add missing malloc() return-code check.
This commit is contained in:
16
src/cache.c
16
src/cache.c
@@ -945,15 +945,15 @@ void cache_reload(void)
|
|||||||
/* Add CNAMEs to interface_names to the cache */
|
/* Add CNAMEs to interface_names to the cache */
|
||||||
for (a = daemon->cnames; a; a = a->next)
|
for (a = daemon->cnames; a; a = a->next)
|
||||||
for (intr = daemon->int_names; intr; intr = intr->next)
|
for (intr = daemon->int_names; intr; intr = intr->next)
|
||||||
if (hostname_isequal(a->target, intr->name))
|
if (hostname_isequal(a->target, intr->name) &&
|
||||||
|
((cache = whine_malloc(sizeof(struct crec)))))
|
||||||
{
|
{
|
||||||
struct crec *aliasc = whine_malloc(sizeof(struct crec));
|
cache->flags = F_FORWARD | F_NAMEP | F_CNAME | F_IMMORTAL | F_CONFIG;
|
||||||
aliasc->flags = F_FORWARD | F_NAMEP | F_CNAME | F_IMMORTAL | F_CONFIG;
|
cache->name.namep = a->alias;
|
||||||
aliasc->name.namep = a->alias;
|
cache->addr.cname.target.int_name = intr;
|
||||||
aliasc->addr.cname.target.int_name = intr;
|
cache->addr.cname.uid = -1;
|
||||||
aliasc->addr.cname.uid = -1;
|
cache_hash(cache);
|
||||||
cache_hash(aliasc);
|
add_hosts_cname(cache); /* handle chains */
|
||||||
add_hosts_cname(aliasc); /* handle chains */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* borrow the packet buffer for a temporary by-address hash */
|
/* borrow the packet buffer for a temporary by-address hash */
|
||||||
|
|||||||
Reference in New Issue
Block a user