Kieran Mansley - kjm25@cam.ac.uk - 20th September 2004

* Check if the pbuf is NULL before freeing it, when draining the mbox as part of netconn_delete.
This commit is contained in:
kieranm 2004-09-20 16:58:01 +00:00
parent 4cb8192c1d
commit 19d8ffe177

View File

@ -280,9 +280,10 @@ netconn_delete(struct netconn *conn)
if (conn->recvmbox != SYS_MBOX_NULL) {
while (sys_arch_mbox_fetch(conn->recvmbox, &mem, 1) != SYS_ARCH_TIMEOUT) {
if (conn->type == NETCONN_TCP) {
pbuf_free((struct pbuf *)mem);
if(mem != NULL)
pbuf_free((struct pbuf *)mem);
} else {
netbuf_delete((struct netbuf *)mem);
netbuf_delete((struct netbuf *)mem);
}
}
sys_mbox_free(conn->recvmbox);