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");