Found a leak fix patch from years ago

svn path=/trunk/; revision=45550
This commit is contained in:
Ged Murphy 2010-02-10 08:24:34 +00:00
parent 8e0c1b2fb4
commit 9709c3dfb9

View file

@ -183,9 +183,8 @@ LPTSTR GetConnectionType(LPTSTR lpClass)
ConType = (LPTSTR)HeapAlloc(ProcessHeap,
0,
dwDataSize);
if (ConType == NULL)
return NULL;
if (ConType)
{
if(RegQueryValueEx(hKey,
_T("Name"),
NULL,
@ -193,10 +192,15 @@ LPTSTR GetConnectionType(LPTSTR lpClass)
(PBYTE)ConType,
&dwDataSize) != ERROR_SUCCESS)
{
HeapFree(ProcessHeap,
0,
ConType);
ConType = NULL;
}
}
}
}
if (hKey != NULL)
RegCloseKey(hKey);
@ -456,7 +460,9 @@ VOID ShowInfo(BOOL bAll)
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"));