mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
(jdgleaver) Initialize string lists properly to prevent memory leaks
This commit is contained in:
parent
ce185d8be6
commit
6af6d5eb1c
@ -261,8 +261,8 @@ static core_info_list_t *core_info_list_new(const char *path,
|
||||
const char *exts,
|
||||
bool dir_show_hidden_files)
|
||||
{
|
||||
struct string_list contents;
|
||||
size_t i;
|
||||
struct string_list contents = {0};
|
||||
core_info_t *core_info = NULL;
|
||||
core_info_list_t *core_info_list = NULL;
|
||||
const char *path_basedir = libretro_info_dir;
|
||||
|
@ -428,7 +428,7 @@ bool slang_preprocess_parse_parameters(const char *shader_path,
|
||||
struct video_shader *shader)
|
||||
{
|
||||
glslang_meta meta;
|
||||
struct string_list lines;
|
||||
struct string_list lines = {0};
|
||||
|
||||
if (!string_list_initialize(&lines))
|
||||
goto error;
|
||||
|
@ -536,9 +536,9 @@ static int general_push(menu_displaylist_info_t *info,
|
||||
case PUSH_ARCHIVE_OPEN_DETECT_CORE:
|
||||
case PUSH_DETECT_CORE_LIST:
|
||||
{
|
||||
struct string_list str_list2;
|
||||
union string_list_elem_attr attr;
|
||||
char newstring[PATH_MAX_LENGTH];
|
||||
struct string_list str_list2 = {0};
|
||||
struct retro_system_info *system = runloop_get_libretro_system_info();
|
||||
|
||||
newstring[0] = '\0';
|
||||
|
@ -11529,7 +11529,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
|
||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
|
||||
{
|
||||
struct string_list str_list;
|
||||
struct string_list str_list = {0};
|
||||
char new_exts[PATH_MAX_LENGTH];
|
||||
union string_list_elem_attr attr;
|
||||
|
||||
|
@ -11384,7 +11384,7 @@ void path_set_special(char **argv, unsigned num_content)
|
||||
unsigned i;
|
||||
char str[PATH_MAX_LENGTH];
|
||||
union string_list_elem_attr attr;
|
||||
struct string_list subsystem_paths;
|
||||
struct string_list subsystem_paths = {0};
|
||||
struct rarch_state *p_rarch = &rarch_st;
|
||||
global_t *global = &p_rarch->g_extern;
|
||||
const char *savestate_dir = p_rarch->current_savestate_dir;
|
||||
@ -30041,7 +30041,7 @@ bool audio_driver_mixer_extension_supported(const char *ext)
|
||||
bool ret = false;
|
||||
|
||||
attr.i = 0;
|
||||
if (string_list_initialize(&str_list))
|
||||
if (!string_list_initialize(&str_list))
|
||||
return false;
|
||||
|
||||
#ifdef HAVE_STB_VORBIS
|
||||
|
Loading…
x
Reference in New Issue
Block a user