net: Release net_buf in a case of error in IPv6 packet processing

Change-Id: Ic29762737d3d71e97a45cbe9bfccfb0dd1c1bb2f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2015-05-04 14:50:48 +03:00 committed by Anas Nashif
commit 210d10b036

View file

@ -2324,6 +2324,11 @@ uip_process(struct net_buf *buf, uint8_t flag)
return;
drop:
/* If there is an error, then just return the buffer to pool */
if (uip_len(buf) == 0) {
net_buf_put(buf);
}
uip_len(buf) = 0;
uip_ext_len(buf) = 0;
uip_ext_bitmap(buf) = 0;