Commit 81cde92b authored by roel0's avatar roel0

Resolved memory leak

parent 006cac8d
......@@ -308,7 +308,9 @@ static int32_t pico_ethsend_local(struct pico_frame *f, struct pico_eth_hdr *hdr
dbg("sending out packet destined for our own mac\n");
if (pico_ethernet_receive(clone) < 0) {
dbg("pico_ethernet_receive() failed\n");
return 0;
}
pico_frame_discard(f);
return 1;
}
......@@ -317,7 +319,7 @@ static int32_t pico_ethsend_local(struct pico_frame *f, struct pico_eth_hdr *hdr
/* Ethernet send, second attempt: try bcast.
* Returns 0 if the packet is not bcast, so it will be handled somewhere else.
* Returns 1 if the packet is handled by the pico_device_broadcast() function, so it can be discarded.
* Returns 1 if the packet is handled by the pico_device_broadcast() function and is discarded
* */
static int32_t pico_ethsend_bcast(struct pico_frame *f)
{
......
......@@ -470,6 +470,7 @@ int32_t pico_device_broadcast(struct pico_frame *f)
ret = f->dev->send(f->dev, f->start, (int)f->len);
}
}
pico_frame_discard(f);
return ret;
}
......
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