Author: cgutman
Date: Wed Jul 3 10:22:11 2013
New Revision: 59414
URL:
http://svn.reactos.org/svn/reactos?rev=59414&view=rev
Log:
[LWIP]
- Don't leak PCBs for connections that were not accepted
Modified:
trunk/reactos/lib/drivers/lwip/src/rostcp.c
Modified: trunk/reactos/lib/drivers/lwip/src/rostcp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/lwip/src/rostc…
==============================================================================
--- trunk/reactos/lib/drivers/lwip/src/rostcp.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/lwip/src/rostcp.c [iso-8859-1] Wed Jul 3 10:22:11 2013
@@ -248,13 +248,15 @@
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
err_t
InternalAcceptEventHandler(void *arg, PTCP_PCB newpcb, const err_t err)
{
/* Make sure the socket didn't get closed */
if (!arg)
- return ERR_ABRT;
+ return ERR_CLSD;
TCPAcceptEventHandler(arg, newpcb);
@@ -262,7 +264,7 @@
if (newpcb->callback_arg)
return ERR_OK;
else
- return ERR_ABRT;
+ return ERR_CLSD;
}
static