mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Tidy up malloc-failure handling.
This commit is contained in:
@@ -266,11 +266,14 @@ static int iface_allowed(struct irec **irecp, int if_index,
|
|||||||
iface->dad = dad;
|
iface->dad = dad;
|
||||||
iface->done = 0;
|
iface->done = 0;
|
||||||
if ((iface->name = whine_malloc(strlen(ifr.ifr_name)+1)))
|
if ((iface->name = whine_malloc(strlen(ifr.ifr_name)+1)))
|
||||||
|
{
|
||||||
strcpy(iface->name, ifr.ifr_name);
|
strcpy(iface->name, ifr.ifr_name);
|
||||||
iface->next = *irecp;
|
iface->next = *irecp;
|
||||||
*irecp = iface;
|
*irecp = iface;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
free(iface);
|
||||||
|
}
|
||||||
|
|
||||||
errno = ENOMEM;
|
errno = ENOMEM;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user