mirror of
https://github.com/reactos/reactos.git
synced 2024-08-04 02:20:54 +00:00
fix some memory leaks (patch by Ged)
svn path=/trunk/; revision=36402
This commit is contained in:
parent
9c5e46aede
commit
31607505af
|
@ -702,6 +702,10 @@ StartServiceCtrlDispatcherA(LPSERVICE_TABLE_ENTRYA lpServiceStartTable)
|
||||||
if (dwError != ERROR_SUCCESS)
|
if (dwError != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Free the service table */
|
/* Free the service table */
|
||||||
|
for (i = 0; i < dwActiveServiceCount; i++)
|
||||||
|
{
|
||||||
|
RtlFreeUnicodeString(&lpActiveServices[i].ServiceName);
|
||||||
|
}
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
|
||||||
lpActiveServices = NULL;
|
lpActiveServices = NULL;
|
||||||
dwActiveServiceCount = 0;
|
dwActiveServiceCount = 0;
|
||||||
|
@ -714,6 +718,10 @@ StartServiceCtrlDispatcherA(LPSERVICE_TABLE_ENTRYA lpServiceStartTable)
|
||||||
if (lpMessageBuffer == NULL)
|
if (lpMessageBuffer == NULL)
|
||||||
{
|
{
|
||||||
/* Free the service table */
|
/* Free the service table */
|
||||||
|
for (i = 0; i < dwActiveServiceCount; i++)
|
||||||
|
{
|
||||||
|
RtlFreeUnicodeString(&lpActiveServices[i].ServiceName);
|
||||||
|
}
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
|
||||||
lpActiveServices = NULL;
|
lpActiveServices = NULL;
|
||||||
dwActiveServiceCount = 0;
|
dwActiveServiceCount = 0;
|
||||||
|
@ -728,6 +736,10 @@ StartServiceCtrlDispatcherA(LPSERVICE_TABLE_ENTRYA lpServiceStartTable)
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, lpMessageBuffer);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, lpMessageBuffer);
|
||||||
|
|
||||||
/* Free the service table */
|
/* Free the service table */
|
||||||
|
for (i = 0; i < dwActiveServiceCount; i++)
|
||||||
|
{
|
||||||
|
RtlFreeUnicodeString(&lpActiveServices[i].ServiceName);
|
||||||
|
}
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
|
||||||
lpActiveServices = NULL;
|
lpActiveServices = NULL;
|
||||||
dwActiveServiceCount = 0;
|
dwActiveServiceCount = 0;
|
||||||
|
@ -780,6 +792,10 @@ StartServiceCtrlDispatcherW(LPSERVICE_TABLE_ENTRYW lpServiceStartTable)
|
||||||
if (dwError != ERROR_SUCCESS)
|
if (dwError != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
/* Free the service table */
|
/* Free the service table */
|
||||||
|
for (i = 0; i < dwActiveServiceCount; i++)
|
||||||
|
{
|
||||||
|
RtlFreeUnicodeString(&lpActiveServices[i].ServiceName);
|
||||||
|
}
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
|
||||||
lpActiveServices = NULL;
|
lpActiveServices = NULL;
|
||||||
dwActiveServiceCount = 0;
|
dwActiveServiceCount = 0;
|
||||||
|
@ -792,6 +808,10 @@ StartServiceCtrlDispatcherW(LPSERVICE_TABLE_ENTRYW lpServiceStartTable)
|
||||||
if (lpMessageBuffer == NULL)
|
if (lpMessageBuffer == NULL)
|
||||||
{
|
{
|
||||||
/* Free the service table */
|
/* Free the service table */
|
||||||
|
for (i = 0; i < dwActiveServiceCount; i++)
|
||||||
|
{
|
||||||
|
RtlFreeUnicodeString(&lpActiveServices[i].ServiceName);
|
||||||
|
}
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
|
||||||
lpActiveServices = NULL;
|
lpActiveServices = NULL;
|
||||||
dwActiveServiceCount = 0;
|
dwActiveServiceCount = 0;
|
||||||
|
@ -806,6 +826,10 @@ StartServiceCtrlDispatcherW(LPSERVICE_TABLE_ENTRYW lpServiceStartTable)
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, lpMessageBuffer);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, lpMessageBuffer);
|
||||||
|
|
||||||
/* Free the service table */
|
/* Free the service table */
|
||||||
|
for (i = 0; i < dwActiveServiceCount; i++)
|
||||||
|
{
|
||||||
|
RtlFreeUnicodeString(&lpActiveServices[i].ServiceName);
|
||||||
|
}
|
||||||
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
|
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
|
||||||
lpActiveServices = NULL;
|
lpActiveServices = NULL;
|
||||||
dwActiveServiceCount = 0;
|
dwActiveServiceCount = 0;
|
||||||
|
|
Loading…
Reference in a new issue