X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprocess.c;h=4e779532efdc7c48b53ff55064309c6be978adfc;hp=11e8b4fc7b98920fadb981e4fe1c7cc74eced74d;hb=4a1740ede7c1992f7f3da5e197db9975c0344ac3;hpb=de78d79db84c486afcc353884ec1770866beb653 diff --git a/src/process.c b/src/process.c index 11e8b4fc..4e779532 100644 --- a/src/process.c +++ b/src/process.c @@ -154,6 +154,9 @@ bool remove_service(void) { DWORD WINAPI controlhandler(DWORD request, DWORD type, LPVOID boe, LPVOID bah) { switch(request) { + case SERVICE_CONTROL_INTERROGATE: + SetServiceStatus(statushandle, &status); + return NO_ERROR; case SERVICE_CONTROL_STOP: logger(LOG_NOTICE, _("Got %s request"), "SERVICE_CONTROL_STOP"); break; @@ -379,8 +382,10 @@ bool execute_script(const char *name, char **envp) /* First check if there is a script */ - if(stat(scriptname + 1, &s)) + if(stat(scriptname + 1, &s)) { + free(scriptname); return true; + } ifdebug(STATUS) logger(LOG_INFO, _("Executing script %s"), name);