From: Guus Sliepen Date: Tue, 21 Feb 2012 10:39:21 +0000 (+0100) Subject: Move initialization of char *priority up to prevent freeing an uninitialized pointer. X-Git-Tag: import-tinc-1.1~403^2~4 X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=7d76e287598c8c18cadfb5818046d9dd1b0ad881;p=meshlink Move initialization of char *priority up to prevent freeing an uninitialized pointer. --- diff --git a/src/tincd.c b/src/tincd.c index f7b956fe..c5f4c103 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -586,6 +586,7 @@ int main2(int argc, char **argv) { InitializeCriticalSection(&mutex); EnterCriticalSection(&mutex); #endif + char *priority = NULL; if(!detach()) return 1; @@ -612,8 +613,6 @@ int main2(int argc, char **argv) { /* Change process priority */ - char *priority = NULL; - if(get_config_string(lookup_config(config_tree, "ProcessPriority"), &priority)) { if(!strcasecmp(priority, "Normal")) { if (setpriority(NORMAL_PRIORITY_CLASS) != 0) {