]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
main: allocate str_list_t string arrays in BSS
authorJaroslav Kysela <perex@perex.cz>
Fri, 19 Aug 2016 10:22:58 +0000 (12:22 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 19 Aug 2016 10:22:58 +0000 (12:22 +0200)
src/main.c

index b96e3577ea55183396e0b5cd683329c12c0e6912..bc70832eb02ef237907d8c96f063a4d5c881c803 100644 (file)
@@ -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();