Commit 38365ff0 authored by Simon Kelley's avatar Simon Kelley

Theoretical memory leak fix.

parent 9c4270bc
......@@ -258,15 +258,18 @@ static int iface_allowed(struct irec **irecp, int if_index,
if (lo->name && strcmp(lo->name, ifr.ifr_name) == 0)
break;
if (!lo &&
(lo = whine_malloc(sizeof(struct iname))) &&
(lo->name = whine_malloc(strlen(ifr.ifr_name)+1)))
if (!lo && (lo = whine_malloc(sizeof(struct iname))))
{
if ((lo->name = whine_malloc(strlen(ifr.ifr_name)+1)))
{
strcpy(lo->name, ifr.ifr_name);
lo->used = 1;
lo->next = daemon->if_names;
daemon->if_names = lo;
}
else
free(lo);
}
}
if (addr->sa.sa_family == AF_INET &&
......
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