Commit 6f13e538 authored by Simon Kelley's avatar Simon Kelley

Tidy up malloc-failure handling.

parent d1c759c5
...@@ -266,11 +266,14 @@ static int iface_allowed(struct irec **irecp, int if_index, ...@@ -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;
......
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