diff --git a/features/FEATURE_LWIP/lwip-interface/lwip_stack.c b/features/FEATURE_LWIP/lwip-interface/lwip_stack.c index 218548cffe..454db2d6f0 100644 --- a/features/FEATURE_LWIP/lwip-interface/lwip_stack.c +++ b/features/FEATURE_LWIP/lwip-interface/lwip_stack.c @@ -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);