* Sync up to trunk head (r64894).
[reactos.git] / base / applications / mscutils / servman / query.c
index 14a68e5..3a5e82c 100644 (file)
@@ -270,6 +270,7 @@ GetServiceList(PMAIN_WND_INFO Info,
         HeapFree(ProcessHeap,
                      0,
                      Info->pAllServices);
+        Info->pAllServices = NULL;
     }
 
     ScHandle = OpenSCManager(NULL,
@@ -319,7 +320,7 @@ GetServiceList(PMAIN_WND_INFO Info,
     if (ScHandle)
         CloseServiceHandle(ScHandle);
 
-    if (!bRet)
+    if (!bRet && Info->pAllServices)
     {
         HeapFree(ProcessHeap,
                  0,