Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
main: allocate str_list_t string arrays in BSS
  • Loading branch information
perexg committed Aug 19, 2016
1 parent 46b2e25 commit f864d62
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/main.c
Expand Up @@ -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 },
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit f864d62

Please sign in to comment.