X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fprocess.c;h=262b092c165404dd2e78f8e586a6661fac611b8a;hp=a682226808725729c88f49796d00bb1d4902480b;hb=66e702d90d83977dc089736d7e4146330bc5df28;hpb=f421a640777bd9484c59fa6feacadcf3e05d4b44 diff --git a/src/process.c b/src/process.c index a6822268..262b092c 100644 --- a/src/process.c +++ b/src/process.c @@ -358,7 +358,7 @@ bool execute_script(const char *name, char **envp) { int status, len; char *scriptname; int i; - char *aInterpreter = NULL; + char *interpreter = NULL; #ifndef HAVE_MINGW len = xasprintf(&scriptname, "\"%s/%s\"", confbase, name); @@ -379,19 +379,15 @@ bool execute_script(const char *name, char **envp) { } #endif - // Custom scripts interpreter - if(get_config_string(lookup_config(config_tree, "ScriptsInterpreter"), &aInterpreter)) - { - // Force custom scripts interpreter allowing execution of scripts on android without execution flag (such as on /sdcard) - free(scriptname); - len = xasprintf(&scriptname, "%s \"%s/%s\"", aInterpreter, confbase, name); - if(len < 0) - { - free(aInterpreter); - return false; - } - } - free(aInterpreter); + // Custom scripts interpreter + if(get_config_string(lookup_config(config_tree, "ScriptsInterpreter"), &interpreter)) { + // Force custom scripts interpreter allowing execution of scripts on android without execution flag (such as on /sdcard) + free(scriptname); + len = xasprintf(&scriptname, "%s \"%s/%s\"", interpreter, confbase, name); + free(interpreter); + if(len < 0) + return false; + } ifdebug(STATUS) logger(LOG_INFO, "Executing script %s", name);