From: Jaroslav Kysela Date: Fri, 19 Aug 2016 10:22:58 +0000 (+0200) Subject: main: allocate str_list_t string arrays in BSS X-Git-Tag: v4.2.1~359 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f864d62183cde86ac5fe55dd28728926b2a66736;p=thirdparty%2Ftvheadend.git main: allocate str_list_t string arrays in BSS --- diff --git a/src/main.c b/src/main.c index b96e3577e..bc70832eb 100644 --- a/src/main.c +++ b/src/main.c @@ -804,8 +804,10 @@ main(int argc, char **argv) *opt_subscribe = NULL, *opt_user_agent = NULL, *opt_satip_bindaddr = NULL; - str_list_t opt_satip_xml = { .max = 10, .num = 0, .str = calloc(10, sizeof(char*)) }; - str_list_t opt_tsfile = { .max = 10, .num = 0, .str = calloc(10, sizeof(char*)) }; + static char *__opt_satip_xml[10]; + str_list_t opt_satip_xml = { .max = 10, .num = 0, .str = __opt_satip_xml }; + static char *__opt_satip_tsfile[10]; + str_list_t opt_tsfile = { .max = 10, .num = 0, .str = __opt_satip_tsfile }; cmdline_opt_t cmdline_opts[] = { { 0, NULL, N_("Generic options"), OPT_BOOL, NULL }, { 'h', "help", N_("Show this page"), OPT_BOOL, &opt_help }, @@ -1356,11 +1358,6 @@ main(int argc, char **argv) if(opt_fork) unlink(opt_pidpath); -#if ENABLE_TSFILE - free(opt_tsfile.str); -#endif - free(opt_satip_xml.str); - /* OpenSSL - welcome to the "cleanup" hell */ ENGINE_cleanup(); RAND_cleanup();