From 7a6d2cb5e61807766176d8ab512bb3cac4e8d92f Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Sat, 30 Sep 2017 19:03:39 -0400 Subject: [PATCH] set list to NULL after free in case autoconfig directory is empty --- tasks/task_autodetect.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 2152f287c7..7a25d9bc61 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -242,7 +242,10 @@ static bool input_autoconfigure_joypad_from_conf_dir( if (!list || !list->size) { if (list) + { string_list_free(list); + list = NULL; + } if (!string_is_empty(params->autoconfig_directory)) list = dir_list_new_special(params->autoconfig_directory, DIR_LIST_AUTOCONFIG, "cfg");