mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 22:56:00 +00:00
1. revert my last changes to this file
2. Did solv the heapfree null check with if statement svn path=/trunk/; revision=22733
This commit is contained in:
parent
11963867d1
commit
3f9f57f91e
1 changed files with 36 additions and 36 deletions
|
@ -443,7 +443,7 @@ CreateServiceA(SC_HANDLE hSCManager,
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
|
||||||
return NULL;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
MultiByteToWideChar(CP_ACP, 0, lpServiceName, -1, lpServiceNameW, len);
|
MultiByteToWideChar(CP_ACP, 0, lpServiceName, -1, lpServiceNameW, len);
|
||||||
}
|
}
|
||||||
|
@ -456,8 +456,7 @@ CreateServiceA(SC_HANDLE hSCManager,
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpServiceNameW);
|
goto cleanup;
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
MultiByteToWideChar(CP_ACP, 0, lpDisplayName, -1, lpDisplayNameW, len);
|
MultiByteToWideChar(CP_ACP, 0, lpDisplayName, -1, lpDisplayNameW, len);
|
||||||
}
|
}
|
||||||
|
@ -470,9 +469,7 @@ CreateServiceA(SC_HANDLE hSCManager,
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpServiceNameW);
|
goto cleanup;
|
||||||
HeapFree(GetProcessHeap(), 0, lpDisplayNameW);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
MultiByteToWideChar(CP_ACP, 0, lpDisplayName, -1, lpBinaryPathNameW, len);
|
MultiByteToWideChar(CP_ACP, 0, lpDisplayName, -1, lpBinaryPathNameW, len);
|
||||||
}
|
}
|
||||||
|
@ -485,10 +482,7 @@ CreateServiceA(SC_HANDLE hSCManager,
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpServiceNameW);
|
goto cleanup;
|
||||||
HeapFree(GetProcessHeap(), 0, lpDisplayNameW);
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpBinaryPathNameW);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
MultiByteToWideChar(CP_ACP, 0, lpLoadOrderGroup, -1, lpLoadOrderGroupW, len);
|
MultiByteToWideChar(CP_ACP, 0, lpLoadOrderGroup, -1, lpLoadOrderGroupW, len);
|
||||||
}
|
}
|
||||||
|
@ -509,11 +503,7 @@ CreateServiceA(SC_HANDLE hSCManager,
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpServiceNameW);
|
goto cleanup;
|
||||||
HeapFree(GetProcessHeap(), 0, lpDisplayNameW);
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpBinaryPathNameW);
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpLoadOrderGroupW);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
MultiByteToWideChar(CP_ACP, 0, lpDependencies, -1, lpDependenciesW, dwDependenciesLength);
|
MultiByteToWideChar(CP_ACP, 0, lpDependencies, -1, lpDependenciesW, dwDependenciesLength);
|
||||||
}
|
}
|
||||||
|
@ -526,12 +516,7 @@ CreateServiceA(SC_HANDLE hSCManager,
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpServiceNameW);
|
goto cleanup;
|
||||||
HeapFree(GetProcessHeap(), 0, lpDisplayNameW);
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpBinaryPathNameW);
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpLoadOrderGroupW);
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpDependenciesW);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
MultiByteToWideChar(CP_ACP, 0, lpServiceStartName, -1, lpServiceStartNameW, len);
|
MultiByteToWideChar(CP_ACP, 0, lpServiceStartName, -1, lpServiceStartNameW, len);
|
||||||
}
|
}
|
||||||
|
@ -544,13 +529,7 @@ CreateServiceA(SC_HANDLE hSCManager,
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpServiceNameW);
|
goto cleanup;
|
||||||
HeapFree(GetProcessHeap(), 0, lpDisplayNameW);
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpBinaryPathNameW);
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpLoadOrderGroupW);
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpDependenciesW);
|
|
||||||
HeapFree(GetProcessHeap(), 0, lpServiceStartNameW);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
MultiByteToWideChar(CP_ACP, 0, lpPassword, -1, lpPasswordW, len);
|
MultiByteToWideChar(CP_ACP, 0, lpPassword, -1, lpPasswordW, len);
|
||||||
}
|
}
|
||||||
|
@ -569,14 +548,35 @@ CreateServiceA(SC_HANDLE hSCManager,
|
||||||
lpServiceStartNameW,
|
lpServiceStartNameW,
|
||||||
lpPasswordW);
|
lpPasswordW);
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
if (lpServiceNameW !=NULL)
|
||||||
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, lpServiceNameW);
|
HeapFree(GetProcessHeap(), 0, lpServiceNameW);
|
||||||
|
}
|
||||||
|
if (lpDisplayNameW != NULL)
|
||||||
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, lpDisplayNameW);
|
HeapFree(GetProcessHeap(), 0, lpDisplayNameW);
|
||||||
|
}
|
||||||
|
if (lpBinaryPathNameW != NULL)
|
||||||
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, lpBinaryPathNameW);
|
HeapFree(GetProcessHeap(), 0, lpBinaryPathNameW);
|
||||||
|
}
|
||||||
|
if (lpLoadOrderGroupW != NULL)
|
||||||
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, lpLoadOrderGroupW);
|
HeapFree(GetProcessHeap(), 0, lpLoadOrderGroupW);
|
||||||
|
}
|
||||||
|
if (lpDependenciesW != NULL)
|
||||||
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, lpDependenciesW);
|
HeapFree(GetProcessHeap(), 0, lpDependenciesW);
|
||||||
|
}
|
||||||
|
if (lpServiceStartNameW != NULL)
|
||||||
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, lpServiceStartNameW);
|
HeapFree(GetProcessHeap(), 0, lpServiceStartNameW);
|
||||||
|
}
|
||||||
|
if (lpPasswordW != NULL)
|
||||||
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, lpPasswordW);
|
HeapFree(GetProcessHeap(), 0, lpPasswordW);
|
||||||
|
}
|
||||||
|
|
||||||
return RetVal;
|
return RetVal;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue