Author: pschweitzer
Date: Thu Sep 3 21:27:51 2015
New Revision: 68968
URL:
http://svn.reactos.org/svn/reactos?rev=68968&view=rev
Log:
[ADVAPI32]
Fix memory leaks in case of failure
CID 1322129
CID 1322130
Modified:
trunk/reactos/dll/win32/advapi32/service/sctrl.c
Modified: trunk/reactos/dll/win32/advapi32/service/sctrl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/service/sctrl.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/service/sctrl.c [iso-8859-1] Thu Sep 3 21:27:51
2015
@@ -472,7 +472,10 @@
&ThreadParamsW->dwArgCount,
&ThreadParamsW->lpArgVector);
if (dwError != ERROR_SUCCESS)
+ {
+ HeapFree(GetProcessHeap(), 0, ThreadParamsW);
return dwError;
+ }
ThreadParamsW->lpServiceMain = lpService->ServiceMain.W;
ThreadHandle = CreateThread(NULL,
0,
@@ -500,7 +503,10 @@
&ThreadParamsA->dwArgCount,
&ThreadParamsA->lpArgVector);
if (dwError != ERROR_SUCCESS)
+ {
+ HeapFree(GetProcessHeap(), 0, ThreadParamsA);
return dwError;
+ }
ThreadParamsA->lpServiceMain = lpService->ServiceMain.A;
ThreadHandle = CreateThread(NULL,
0,