mirror of
https://github.com/libretro/RetroArch
synced 2025-03-31 10:20: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:
|
end:
|
||||||
menu_entry_free(&entry);
|
menu_entry_free(&entry);
|
||||||
|
if (!string_is_empty(tmp))
|
||||||
|
free(tmp);
|
||||||
free(tmp_new);
|
free(tmp_new);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2315,8 +2317,20 @@ static int xmb_draw_item(
|
|||||||
entry_type = menu_entry_get_type_new(entry);
|
entry_type = menu_entry_get_type_new(entry);
|
||||||
|
|
||||||
if (entry_type == FILE_TYPE_CONTENTLIST_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)) ||
|
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))))
|
(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;
|
uint64_t frame_count = xmb ? xmb->frame_count : 0;
|
||||||
const char *thumb_ident = xmb_thumbnails_ident();
|
const char *thumb_ident = xmb_thumbnails_ident();
|
||||||
|
|
||||||
if (!list || !list->size)
|
if (!list || !list->size || !xmb)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (cat_selection_ptr > xmb->system_tab_end)
|
if (cat_selection_ptr > xmb->system_tab_end)
|
||||||
|
@ -251,7 +251,10 @@ static bool input_autoconfigure_joypad_from_conf_dir(
|
|||||||
if(!list)
|
if(!list)
|
||||||
return false;
|
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++)
|
for (i = 0; i < list->size; i++)
|
||||||
{
|
{
|
||||||
@ -474,11 +477,12 @@ bool input_autoconfigure_connect(
|
|||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task));
|
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();
|
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;
|
goto error;
|
||||||
|
|
||||||
state->name = NULL;
|
state->name = NULL;
|
||||||
@ -517,8 +521,8 @@ bool input_autoconfigure_connect(
|
|||||||
|
|
||||||
input_autoconfigured[state->idx] = false;
|
input_autoconfigured[state->idx] = false;
|
||||||
|
|
||||||
task->state = state;
|
task->state = state;
|
||||||
task->handler = input_autoconfigure_connect_handler;
|
task->handler = input_autoconfigure_connect_handler;
|
||||||
|
|
||||||
task_queue_push(task);
|
task_queue_push(task);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user