- fix resource leaks CID 716292, 716293, 716294
- fix CID 716772 (double free), 513719 (wrong NULL check),
1206739 (cosmetic)
- make line endings CR LF when exporting the services list
svn path=/trunk/; revision=64882
if(hFile != INVALID_HANDLE_VALUE)
{
TCHAR LVText[500];
if(hFile != INVALID_HANDLE_VALUE)
{
TCHAR LVText[500];
+ TCHAR newl[2] = {_T('\r'), _T('\n')};
TCHAR tab = _T('\t');
DWORD dwTextLength, dwWritten;
INT NumListedServ = 0;
TCHAR tab = _T('\t');
DWORD dwTextLength, dwWritten;
INT NumListedServ = 0;
{
WriteFile(hFile,
LVText,
{
WriteFile(hFile,
LVText,
- &newl,
- sizeof(TCHAR),
SendMessage(Info->hTool, TB_SETSTATE, ID_RESTART,
(LPARAM)MAKELONG(TBSTATE_ENABLED, 0));
}
SendMessage(Info->hTool, TB_SETSTATE, ID_RESTART,
(LPARAM)MAKELONG(TBSTATE_ENABLED, 0));
}
HeapFree(GetProcessHeap(), 0, lpServiceConfig);
HeapFree(GetProcessHeap(), 0, lpServiceConfig);
if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) )
{
if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) )
{
- HeapFree(GetProcessHeap(),
- 0,
- lpProgStr);
}
/* Finally, show and update the progress dialog */
}
/* Finally, show and update the progress dialog */
{
hButton = GetDlgItem(hwndDlg, IDC_START);
EnableWindow (hButton, TRUE);
{
hButton = GetDlgItem(hwndDlg, IDC_START);
EnableWindow (hButton, TRUE);
- HeapFree(GetProcessHeap(), 0, lpServiceConfig);
}
else if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) )
{
}
else if ( (Flags & SERVICE_ACCEPT_STOP) && (State == SERVICE_RUNNING) )
{
EnableWindow (hButton, TRUE);
}
EnableWindow (hButton, TRUE);
}
+ if(lpServiceConfig)
+ HeapFree(GetProcessHeap(), 0, lpServiceConfig);
+
hButton = GetDlgItem(hwndDlg, IDC_START_PARAM);
EnableWindow(hButton, (State == SERVICE_STOPPED));
hButton = GetDlgItem(hwndDlg, IDC_START_PARAM);
EnableWindow(hButton, (State == SERVICE_STOPPED));
HeapFree(ProcessHeap,
0,
Info->pAllServices);
HeapFree(ProcessHeap,
0,
Info->pAllServices);
+ Info->pAllServices = NULL;
}
ScHandle = OpenSCManager(NULL,
}
ScHandle = OpenSCManager(NULL,
if (ScHandle)
CloseServiceHandle(ScHandle);
if (ScHandle)
CloseServiceHandle(ScHandle);
+ if (!bRet && Info->pAllServices)
{
HeapFree(ProcessHeap,
0,
{
HeapFree(ProcessHeap,
0,
LB_ADDSTRING,
0,
(LPARAM)lpServiceConfig->lpDisplayName);
LB_ADDSTRING,
0,
(LPARAM)lpServiceConfig->lpDisplayName);
+
+ HeapFree(GetProcessHeap(), 0, lpServiceConfig);
}
/* Move onto the next string */
}
/* Move onto the next string */