Author: cwittich
Date: Mon Sep 22 07:18:12 2008
New Revision: 36402
URL:
http://svn.reactos.org/svn/reactos?rev=36402&view=rev
Log:
fix some memory leaks (patch by Ged)
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] Mon Sep 22 07:18:12
2008
@@ -702,6 +702,10 @@
if (dwError != ERROR_SUCCESS)
{
/* Free the service table */
+ for (i = 0; i < dwActiveServiceCount; i++)
+ {
+ RtlFreeUnicodeString(&lpActiveServices[i].ServiceName);
+ }
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
lpActiveServices = NULL;
dwActiveServiceCount = 0;
@@ -714,6 +718,10 @@
if (lpMessageBuffer == NULL)
{
/* Free the service table */
+ for (i = 0; i < dwActiveServiceCount; i++)
+ {
+ RtlFreeUnicodeString(&lpActiveServices[i].ServiceName);
+ }
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
lpActiveServices = NULL;
dwActiveServiceCount = 0;
@@ -728,6 +736,10 @@
RtlFreeHeap(RtlGetProcessHeap(), 0, lpMessageBuffer);
/* Free the service table */
+ for (i = 0; i < dwActiveServiceCount; i++)
+ {
+ RtlFreeUnicodeString(&lpActiveServices[i].ServiceName);
+ }
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
lpActiveServices = NULL;
dwActiveServiceCount = 0;
@@ -780,6 +792,10 @@
if (dwError != ERROR_SUCCESS)
{
/* Free the service table */
+ for (i = 0; i < dwActiveServiceCount; i++)
+ {
+ RtlFreeUnicodeString(&lpActiveServices[i].ServiceName);
+ }
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
lpActiveServices = NULL;
dwActiveServiceCount = 0;
@@ -792,6 +808,10 @@
if (lpMessageBuffer == NULL)
{
/* Free the service table */
+ for (i = 0; i < dwActiveServiceCount; i++)
+ {
+ RtlFreeUnicodeString(&lpActiveServices[i].ServiceName);
+ }
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
lpActiveServices = NULL;
dwActiveServiceCount = 0;
@@ -806,6 +826,10 @@
RtlFreeHeap(RtlGetProcessHeap(), 0, lpMessageBuffer);
/* Free the service table */
+ for (i = 0; i < dwActiveServiceCount; i++)
+ {
+ RtlFreeUnicodeString(&lpActiveServices[i].ServiceName);
+ }
RtlFreeHeap(RtlGetProcessHeap(), 0, lpActiveServices);
lpActiveServices = NULL;
dwActiveServiceCount = 0;