mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
Prevent another Coverity warning - memory corruption
This commit is contained in:
parent
3df545112c
commit
21c1acac73
@ -204,7 +204,8 @@ static void add_sub_conf(config_file_t *conf, char *path)
|
|||||||
char real_path[PATH_MAX_LENGTH];
|
char real_path[PATH_MAX_LENGTH];
|
||||||
config_file_t *sub_conf = NULL;
|
config_file_t *sub_conf = NULL;
|
||||||
struct config_include_list *head = conf->includes;
|
struct config_include_list *head = conf->includes;
|
||||||
struct config_include_list *node = (struct config_include_list*)malloc(sizeof(*node));
|
struct config_include_list *node = (struct config_include_list*)
|
||||||
|
malloc(sizeof(*node));
|
||||||
|
|
||||||
if (node)
|
if (node)
|
||||||
{
|
{
|
||||||
@ -247,15 +248,11 @@ static void add_sub_conf(config_file_t *conf, char *path)
|
|||||||
sub_conf = (config_file_t*)
|
sub_conf = (config_file_t*)
|
||||||
config_file_new_internal(real_path, conf->include_depth + 1);
|
config_file_new_internal(real_path, conf->include_depth + 1);
|
||||||
if (!sub_conf)
|
if (!sub_conf)
|
||||||
{
|
|
||||||
free(path);
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
/* Pilfer internal list. */
|
/* Pilfer internal list. */
|
||||||
add_child_list(conf, sub_conf);
|
add_child_list(conf, sub_conf);
|
||||||
config_file_free(sub_conf);
|
config_file_free(sub_conf);
|
||||||
free(path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool parse_line(config_file_t *conf,
|
static bool parse_line(config_file_t *conf,
|
||||||
@ -280,6 +277,7 @@ static bool parse_line(config_file_t *conf,
|
|||||||
{
|
{
|
||||||
char *line = comment + strlen("include ");
|
char *line = comment + strlen("include ");
|
||||||
char *path = extract_value(line, false);
|
char *path = extract_value(line, false);
|
||||||
|
|
||||||
if (path)
|
if (path)
|
||||||
{
|
{
|
||||||
if (conf->include_depth >= MAX_INCLUDE_DEPTH)
|
if (conf->include_depth >= MAX_INCLUDE_DEPTH)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user