Skip to content

Commit

Permalink
Merge pull request #12869 from kivaisan/fix_lwip_socket_close_with_tr…
Browse files Browse the repository at this point in the history
…aces_5_15

LWIP: don't pbuf_free(NULL) on socket close (5.15-branch)
  • Loading branch information
0xc0170 authored Apr 27, 2020
2 parents ccef87e + 9934496 commit 52f1f28
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion features/lwipstack/LWIPStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ nsapi_error_t LWIP::socket_close(nsapi_socket_t handle)
_event_flag.wait_any(TCP_CLOSED_FLAG, TCP_CLOSE_TIMEOUT);
}
#endif
pbuf_free(s->buf);
if (s->buf) {
pbuf_free(s->buf);
}
err_t err = netconn_delete(s->conn);
arena_dealloc(s);
return err_remap(err);
Expand Down

0 comments on commit 52f1f28

Please sign in to comment.