mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-10-23 11:54:39 +00:00
Tidy up malloc-failure handling.
This commit is contained in:
1 parent
d1c759c5c1
commit
6f13e53886
1 file changed
+7
-4
+7
-4
@@ -266,10 +266,13 @@ static int iface_allowed(struct irec **irecp, int if_index,
|
||||
iface->dad = dad;
|
||||
iface->done = 0;
|
||||
if ((iface->name = whine_malloc(strlen(ifr.ifr_name)+1)))
|
||||
strcpy(iface->name, ifr.ifr_name);
|
||||
iface->next = *irecp;
|
||||
*irecp = iface;
|
||||
return 1;
|
||||
{
|
||||
strcpy(iface->name, ifr.ifr_name);
|
||||
iface->next = *irecp;
|
||||
*irecp = iface;
|
||||
return 1;
|
||||
}
|
||||
free(iface);
|
||||
}
|
||||
|
||||
errno = ENOMEM;
|
||||
|
||||
Reference in new issue
Block a user