mirror of https://github.com/ARMmbed/mbed-os.git
NSAPI/lwIP: Free held netbuf on close
mbed_lwip_socket_recv() takes one netbuf at a time from the netconn API, and it holds a partially-read netbuf if necessary in order to present as a stream for TCP. This held netbuf was not being freed when the socket was closed.pull/3975/head
parent
98eb50f592
commit
2f056f2814
|
@ -648,6 +648,7 @@ static int mbed_lwip_socket_close(nsapi_stack_t *stack, nsapi_socket_t handle)
|
|||
{
|
||||
struct lwip_socket *s = (struct lwip_socket *)handle;
|
||||
|
||||
netbuf_delete(s->buf);
|
||||
err_t err = netconn_delete(s->conn);
|
||||
mbed_lwip_arena_dealloc(s);
|
||||
return mbed_lwip_err_remap(err);
|
||||
|
|
Loading…
Reference in New Issue