mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-10 07:13:59 +00:00
Applied patch #5146 to handle allocation failures in accept() by Kevin Lawson.
This commit is contained in:
parent
dd314e1bdf
commit
1f01634029
@ -228,9 +228,6 @@ accept_function(void *arg, struct tcp_pcb *newpcb, err_t err)
|
|||||||
if (newconn == NULL) {
|
if (newconn == NULL) {
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
newconn->type = NETCONN_TCP;
|
|
||||||
newconn->pcb.tcp = newpcb;
|
|
||||||
setup_tcp(newconn);
|
|
||||||
newconn->recvmbox = sys_mbox_new();
|
newconn->recvmbox = sys_mbox_new();
|
||||||
if (newconn->recvmbox == SYS_MBOX_NULL) {
|
if (newconn->recvmbox == SYS_MBOX_NULL) {
|
||||||
memp_free(MEMP_NETCONN, newconn);
|
memp_free(MEMP_NETCONN, newconn);
|
||||||
@ -249,6 +246,10 @@ accept_function(void *arg, struct tcp_pcb *newpcb, err_t err)
|
|||||||
memp_free(MEMP_NETCONN, newconn);
|
memp_free(MEMP_NETCONN, newconn);
|
||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
|
/* Allocations were OK, setup the PCB etc */
|
||||||
|
newconn->type = NETCONN_TCP;
|
||||||
|
newconn->pcb.tcp = newpcb;
|
||||||
|
setup_tcp(newconn);
|
||||||
newconn->acceptmbox = SYS_MBOX_NULL;
|
newconn->acceptmbox = SYS_MBOX_NULL;
|
||||||
newconn->err = err;
|
newconn->err = err;
|
||||||
/* Register event with callback */
|
/* Register event with callback */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user