Author: cgutman
Date: Mon Aug 25 21:57:12 2008
New Revision: 35656
URL:
http://svn.reactos.org/svn/reactos?rev=35656&view=rev
Log:
- Fix many memory leaks
- Complete with the correct status
Modified:
branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/tcp.c
Modified: branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/tcp.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers…
==============================================================================
--- branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Mon Aug
25 21:57:12 2008
@@ -89,8 +89,10 @@
if( Status == STATUS_PENDING ) {
InsertHeadList( &Connection->ListenRequest, &Bucket->Entry );
break;
- } else
+ } else {
Complete( Bucket->Request.RequestContext, Status, 0 );
+ PoolFreeBuffer( Bucket );
+ }
}
}
@@ -141,6 +143,7 @@
Complete( Bucket->Request.RequestContext,
STATUS_SUCCESS, Received );
+ PoolFreeBuffer( Bucket );
} else if( Status == STATUS_PENDING ) {
InsertHeadList
( &Connection->ReceiveRequest, &Bucket->Entry );
@@ -150,6 +153,7 @@
("Completing Receive request: %x %x\n",
Bucket->Request, Status));
Complete( Bucket->Request.RequestContext, Status, 0 );
+ PoolFreeBuffer( Bucket );
}
}
}
@@ -198,6 +202,7 @@
Complete( Bucket->Request.RequestContext,
STATUS_SUCCESS, Sent );
+ PoolFreeBuffer( Bucket );
} else if( Status == STATUS_PENDING ) {
InsertHeadList
( &Connection->SendRequest, &Bucket->Entry );
@@ -207,6 +212,7 @@
("Completing Send request: %x %x\n",
Bucket->Request, Status));
Complete( Bucket->Request.RequestContext, Status, 0 );
+ PoolFreeBuffer( Bucket );
}
}
}
@@ -225,13 +231,15 @@
ListsToErase[2] = &Connection->ConnectRequest;
IrpStatus [2] = STATUS_UNSUCCESSFUL;
ListsToErase[3] = 0;
+ IrpStatus [3] = 0;
for( i = 0; ListsToErase[i]; i++ ) {
while( !IsListEmpty( ListsToErase[i] ) ) {
Entry = RemoveHeadList( ListsToErase[i] );
Bucket = CONTAINING_RECORD( Entry, TDI_BUCKET, Entry );
Complete = Bucket->Request.RequestNotifyObject;
- Complete( Bucket->Request.RequestContext, STATUS_SUCCESS, 0 );
+ Complete( Bucket->Request.RequestContext, IrpStatus[i], 0 );
+ PoolFreeBuffer( Bucket );
}
}
}