We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 937a80c commit 24ab57cCopy full SHA for 24ab57c
SCShell.c
@@ -61,6 +61,7 @@ int main(int argc, char **argv) {
61
printf("Opening %s\n", serviceName);
62
SC_HANDLE schService = OpenServiceA(schManager, serviceName, SERVICE_ALL_ACCESS);
63
if(schService == NULL) {
64
+ CloseServiceHandle(schManager);
65
printf("OpenServiceA failed %ld\n", GetLastError());
66
ExitProcess(0);
67
}
@@ -105,5 +106,10 @@ int main(int argc, char **argv) {
105
106
107
printf("Service path was restored to \"%s\"\n", originalBinaryPath);
108
109
+
110
+ GlobalFree(lpqsc);
111
+ CloseHandle(hToken);
112
113
+ CloseServiceHandle(schService);
114
return 0;
115
0 commit comments