diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 86dd48c593..99e6f28cd5 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -92,6 +92,9 @@ const char* config_get_menu_driver_options(void) attr.i = 0; + if (!options_l) + return NULL; + for (i = 0; menu_driver_find_handle(i); i++) { const char *opt = menu_driver_find_ident(i); @@ -101,6 +104,13 @@ const char* config_get_menu_driver_options(void) options = (char*)calloc(options_len, sizeof(char)); + if (!options) + { + string_list_free(options_l); + options_l = NULL; + return NULL; + } + string_list_join_concat(options, options_len, options_l, "|"); string_list_free(options_l);