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

Theoretical memory leak fix.

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