From f45ec7f911cc253c8460b7b2639fcf9c95fea6ce Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 30 Jan 2015 07:46:33 +0100 Subject: [PATCH] Cleanups in config_get_video_driver_options --- gfx/video_driver.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 9d796ba47b..612232f18a 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -112,6 +112,9 @@ const char* config_get_video_driver_options(void) attr.i = 0; + if (!options_l) + return NULL; + for (i = 0; video_driver_find_handle(i); i++) { const char *opt = video_driver_find_ident(i); @@ -121,6 +124,13 @@ const char* config_get_video_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);