Since I've allocated net_ifinfo, I'd better free it in all returns

This commit is contained in:
Gregor Richards 2016-11-29 23:31:35 -05:00
parent 8e5e760773
commit b1f9ef6073

View File

@ -167,7 +167,10 @@ bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_p
if ((list = (struct net_ifinfo *) calloc(1, sizeof(struct net_ifinfo))) == NULL)
return false;
if (!net_ifinfo_new(list))
{
free(list);
return false;
}
/* loop through them */
for (i = 0; i < list->size; i++)