mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 05:45:50 +00:00
[LWIP]
- Don't leak PCBs for connections that were not accepted svn path=/trunk/; revision=59414
This commit is contained in:
parent
16f15f2195
commit
21e39738fe
1 changed files with 4 additions and 2 deletions
|
@ -248,13 +248,15 @@ InternalRecvEventHandler(void *arg, PTCP_PCB pcb, struct pbuf *p, const err_t er
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This function MUST return an error value that is not ERR_ABRT or ERR_OK if the connection
|
||||||
|
* is not accepted to avoid leaking the new PCB */
|
||||||
static
|
static
|
||||||
err_t
|
err_t
|
||||||
InternalAcceptEventHandler(void *arg, PTCP_PCB newpcb, const err_t err)
|
InternalAcceptEventHandler(void *arg, PTCP_PCB newpcb, const err_t err)
|
||||||
{
|
{
|
||||||
/* Make sure the socket didn't get closed */
|
/* Make sure the socket didn't get closed */
|
||||||
if (!arg)
|
if (!arg)
|
||||||
return ERR_ABRT;
|
return ERR_CLSD;
|
||||||
|
|
||||||
TCPAcceptEventHandler(arg, newpcb);
|
TCPAcceptEventHandler(arg, newpcb);
|
||||||
|
|
||||||
|
@ -262,7 +264,7 @@ InternalAcceptEventHandler(void *arg, PTCP_PCB newpcb, const err_t err)
|
||||||
if (newpcb->callback_arg)
|
if (newpcb->callback_arg)
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
else
|
else
|
||||||
return ERR_ABRT;
|
return ERR_CLSD;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue