mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 08:37:41 +00:00
Fix some Coverity errors
This commit is contained in:
parent
98ddc80035
commit
2a8b74eeb9
@ -1018,6 +1018,8 @@ static void xmb_update_thumbnail_path(void *data, unsigned i)
|
||||
|
||||
end:
|
||||
menu_entry_free(&entry);
|
||||
if (!string_is_empty(tmp))
|
||||
free(tmp);
|
||||
free(tmp_new);
|
||||
}
|
||||
|
||||
@ -2315,8 +2317,20 @@ static int xmb_draw_item(
|
||||
entry_type = menu_entry_get_type_new(entry);
|
||||
|
||||
if (entry_type == FILE_TYPE_CONTENTLIST_ENTRY)
|
||||
fill_short_pathname_representation(entry->path, entry->path,
|
||||
sizeof(entry->path));
|
||||
{
|
||||
char entry_path[PATH_MAX_LENGTH] = {0};
|
||||
strlcpy(entry_path, entry->path, sizeof(entry_path));
|
||||
|
||||
fill_short_pathname_representation(entry_path, entry_path,
|
||||
sizeof(entry_path));
|
||||
|
||||
if (!string_is_empty(entry_path))
|
||||
{
|
||||
if (!string_is_empty(entry->path))
|
||||
free(entry->path);
|
||||
entry->path = strdup(entry_path);
|
||||
}
|
||||
}
|
||||
|
||||
if (string_is_equal(entry->value, msg_hash_to_str(MENU_ENUM_LABEL_DISABLED)) ||
|
||||
(string_is_equal(entry->value, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_OFF))))
|
||||
@ -2522,7 +2536,7 @@ static void xmb_draw_items(
|
||||
uint64_t frame_count = xmb ? xmb->frame_count : 0;
|
||||
const char *thumb_ident = xmb_thumbnails_ident();
|
||||
|
||||
if (!list || !list->size)
|
||||
if (!list || !list->size || !xmb)
|
||||
return;
|
||||
|
||||
if (cat_selection_ptr > xmb->system_tab_end)
|
||||
|
@ -251,7 +251,10 @@ static bool input_autoconfigure_joypad_from_conf_dir(
|
||||
if(!list)
|
||||
return false;
|
||||
|
||||
RARCH_LOG("[Autoconf]: %d profiles found.\n", list->size);
|
||||
if (list)
|
||||
{
|
||||
RARCH_LOG("[Autoconf]: %d profiles found.\n", list->size);
|
||||
}
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
@ -474,11 +477,12 @@ bool input_autoconfigure_connect(
|
||||
{
|
||||
unsigned i;
|
||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
||||
autoconfig_params_t *state = (autoconfig_params_t*)malloc(sizeof(*state));
|
||||
autoconfig_params_t *state = (autoconfig_params_t*)malloc(sizeof(autoconfig_params_t));
|
||||
settings_t *settings = config_get_ptr();
|
||||
const char *dir_autoconf = settings->paths.directory_autoconfig;
|
||||
const char *dir_autoconf = settings ? settings->paths.directory_autoconfig : NULL;
|
||||
bool autodetect_enable = settings ? settings->bools.input_autodetect_enable : false;
|
||||
|
||||
if (!task || !state || !settings->bools.input_autodetect_enable)
|
||||
if (!task || !state || !autodetect_enable)
|
||||
goto error;
|
||||
|
||||
state->name = NULL;
|
||||
@ -517,8 +521,8 @@ bool input_autoconfigure_connect(
|
||||
|
||||
input_autoconfigured[state->idx] = false;
|
||||
|
||||
task->state = state;
|
||||
task->handler = input_autoconfigure_connect_handler;
|
||||
task->state = state;
|
||||
task->handler = input_autoconfigure_connect_handler;
|
||||
|
||||
task_queue_push(task);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user