Author: gedmurphy
Date: Wed Feb 10 09:24:34 2010
New Revision: 45550
URL:
http://svn.reactos.org/svn/reactos?rev=45550&view=rev
Log:
Found a leak fix patch from years ago
Modified:
trunk/reactos/base/applications/network/ipconfig/ipconfig.c
Modified: trunk/reactos/base/applications/network/ipconfig/ipconfig.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ipconfig/ipconfig.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ipconfig/ipconfig.c [iso-8859-1] Wed Feb 10
09:24:34 2010
@@ -183,17 +183,21 @@
ConType = (LPTSTR)HeapAlloc(ProcessHeap,
0,
dwDataSize);
- if (ConType == NULL)
- return NULL;
-
- if(RegQueryValueEx(hKey,
- _T("Name"),
- NULL,
- &dwType,
- (PBYTE)ConType,
- &dwDataSize) != ERROR_SUCCESS)
- {
- ConType = NULL;
+ if (ConType)
+ {
+ if(RegQueryValueEx(hKey,
+ _T("Name"),
+ NULL,
+ &dwType,
+ (PBYTE)ConType,
+ &dwDataSize) != ERROR_SUCCESS)
+ {
+ HeapFree(ProcessHeap,
+ 0,
+ ConType);
+
+ ConType = NULL;
+ }
}
}
}
@@ -456,7 +460,9 @@
if (bAll)
{
- _tprintf(_T("\tDescription . . . . . . . . . . . : %s\n"),
GetConnectionDescription(pAdapter->AdapterName));
+ LPTSTR lpDesc = GetConnectionDescription(pAdapter->AdapterName);
+ _tprintf(_T("\tDescription . . . . . . . . . . . : %s\n"),
lpDesc);
+ HeapFree(ProcessHeap, 0, lpDesc);
_tprintf(_T("\tPhysical Address. . . . . . . . . : %s\n"),
PrintMacAddr(pAdapter->Address));
if (pAdapter->DhcpEnabled)
_tprintf(_T("\tDHCP Enabled. . . . . . . . . . . : Yes\n"));