Remember to free info after QueryServiceConfig2().
authorIain Patterson <me@iain.cx>
Mon, 30 Dec 2013 11:20:07 +0000 (11:20 +0000)
committerIain Patterson <me@iain.cx>
Wed, 1 Jan 2014 12:41:52 +0000 (12:41 +0000)
We weren't freeing the SERVICE_CONFIG_DELAYED_AUTO_START_INFO buffer
after checking for delayed auto start.

service.cpp

index eec2261..abe745a 100644 (file)
@@ -386,6 +386,7 @@ int pre_edit_service(int argc, TCHAR **argv) {
 \r
       if (QueryServiceConfig2(service->handle, SERVICE_CONFIG_DELAYED_AUTO_START_INFO, (unsigned char *) info, bufsize, &bufsize)) {\r
         if (info->fDelayedAutostart) service->startup = NSSM_STARTUP_DELAYED;\r
+        HeapFree(GetProcessHeap(), 0, info);\r
       }\r
       else {\r
         error = GetLastError();\r