Commit 532066ee authored by Simon Kelley's avatar Simon Kelley

Add missing malloc() return-code check.

parent 25439064
...@@ -945,15 +945,15 @@ void cache_reload(void) ...@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment