Tidy up malloc-failure handling.

This commit is contained in:
Simon Kelley committed 2012-04-17 14:25:06 +01:00
1 parent d1c759c5c1
commit 6f13e53886
1 file changed
+7 -4
+7 -4
View File
@@ -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;