Author: pschweitzer
Date: Sun Apr 6 12:18:05 2014
New Revision: 62645
URL:
http://svn.reactos.org/svn/reactos?rev=62645&view=rev
Log:
[SC]
- Remove dead code
- Fix check for memory deallocation
- Don't leak resource
CID #500056
CID #500057
CID #501497
CID #716313
Modified:
trunk/reactos/base/applications/sc/query.c
trunk/reactos/base/applications/sc/start.c
Modified: trunk/reactos/base/applications/sc/query.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sc/query…
==============================================================================
--- trunk/reactos/base/applications/sc/query.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/sc/query.c [iso-8859-1] Sun Apr 6 12:18:05 2014
@@ -135,14 +135,17 @@
&ResumeHandle,
0))
{
+ CloseServiceHandle(hSCManager);
return NumServices;
}
}
}
ReportLastError();
- if (pServiceStatus)
+ if (*pServiceStatus)
HeapFree(GetProcessHeap(), 0, *pServiceStatus);
+
+ CloseServiceHandle(hSCManager);
return NumServices;
}
@@ -237,8 +240,5 @@
}
}
- if (pServiceStatus)
- HeapFree(GetProcessHeap(), 0, pServiceStatus);
-
return TRUE;
}
Modified: trunk/reactos/base/applications/sc/start.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/sc/start…
==============================================================================
--- trunk/reactos/base/applications/sc/start.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/sc/start.c [iso-8859-1] Sun Apr 6 12:18:05 2014
@@ -74,7 +74,6 @@
fail:
ReportLastError();
- if (pServiceInfo) HeapFree(GetProcessHeap(), 0, pServiceInfo);
if (hSc) CloseServiceHandle(hSc);
if (hSCManager) CloseServiceHandle(hSCManager);
return FALSE;