Merge pull request #12196 from kjbracey-arm/lwipclose

LWIP: don't pbuf_free(NULL) on socket close
pull/12199/head
Martin Kojtal 2020-01-07 15:56:13 +01:00 committed by GitHub
commit c8ac1ef2b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -307,7 +307,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);