Author: pschweitzer
Date: Mon Sep 19 07:55:26 2011
New Revision: 53744
URL:
http://svn.reactos.org/svn/reactos?rev=53744&view=rev
Log:
[ROUTE]
Fix memory leaks
Modified:
trunk/reactos/base/applications/network/route/route.c
Modified: trunk/reactos/base/applications/network/route/route.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/route/route.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/route/route.c [iso-8859-1] Mon Sep 19 07:55:26
2011
@@ -36,7 +36,7 @@
static int PrintRoutes()
{
PMIB_IPFORWARDTABLE IpForwardTable = NULL;
- PIP_ADAPTER_INFO pAdapterInfo;
+ PIP_ADAPTER_INFO pAdapterInfo = NULL;
ULONG Size = 0;
DWORD Error = 0;
ULONG adaptOutBufLen = sizeof(IP_ADAPTER_INFO);
@@ -66,7 +66,6 @@
{
if (!(IpForwardTable = malloc( Size )))
{
- free(pAdapterInfo);
Error = ERROR_NOT_ENOUGH_MEMORY;
goto Error;
}
@@ -148,6 +147,8 @@
else
{
Error:
+ if (pAdapterInfo) free(pAdapterInfo);
+ if (IpForwardTable) free(IpForwardTable);
_ftprintf( stderr, _T("Route enumerate failed\n") );
return Error;
}