mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Merge pull request #1015 from lioncash/whoops
Fix a realloc guard mistake I made in config_file.
This commit is contained in:
commit
850b13ecba
@ -82,7 +82,7 @@ static char *getaline(FILE *file)
|
|||||||
if (index == cur_size)
|
if (index == cur_size)
|
||||||
{
|
{
|
||||||
cur_size *= 2;
|
cur_size *= 2;
|
||||||
newline = (char*)realloc(newline, cur_size + 1);
|
newline_tmp = (char*)realloc(newline, cur_size + 1);
|
||||||
|
|
||||||
if (newline_tmp)
|
if (newline_tmp)
|
||||||
{
|
{
|
||||||
@ -459,6 +459,7 @@ config_file_t *config_file_new_from_string(const char *from_string)
|
|||||||
|
|
||||||
if (!list)
|
if (!list)
|
||||||
{
|
{
|
||||||
|
string_list_free(lines);
|
||||||
config_file_free(conf);
|
config_file_free(conf);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -479,7 +480,7 @@ config_file_t *config_file_new_from_string(const char *from_string)
|
|||||||
if (list != conf->tail)
|
if (list != conf->tail)
|
||||||
free(list);
|
free(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
string_list_free(lines);
|
string_list_free(lines);
|
||||||
|
|
||||||
return conf;
|
return conf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user