mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 13:20:30 +00:00
Resource leaks fixes (catched by Coverity)
This commit is contained in:
parent
9624406438
commit
0f954fd4c8
@ -2010,6 +2010,7 @@ static unsigned cheevos_find_game_id_nes(
|
||||
|
||||
MD5_Update(&ctx, (void*) data, rom_size << 14);
|
||||
MD5_Final(hash, &ctx);
|
||||
free(data);
|
||||
}
|
||||
|
||||
to = timeout;
|
||||
|
@ -82,6 +82,7 @@ int config_userdata_get_float_array(void *userdata, const char *key_str,
|
||||
(*values)[i] = (float)strtod(list->elems[i].data, NULL);
|
||||
*out_num_values = list->size;
|
||||
string_list_free(list);
|
||||
free(str);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -111,6 +112,7 @@ int config_userdata_get_int_array(void *userdata, const char *key_str,
|
||||
(*values)[i] = (int)strtod(list->elems[i].data, NULL);
|
||||
*out_num_values = list->size;
|
||||
string_list_free(list);
|
||||
free(str);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -783,7 +783,10 @@ static struct rpng_process *rpng_process_init(rpng_t *rpng, unsigned *width, uns
|
||||
process->stream = process->stream_backend->stream_new();
|
||||
|
||||
if (!process->stream)
|
||||
{
|
||||
free(process);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!process->stream_backend->stream_decompress_init(process->stream))
|
||||
{
|
||||
|
@ -566,6 +566,7 @@ clean:
|
||||
if (cur.is_valid)
|
||||
libretrodb_cursor_close(&cur);
|
||||
bintree_free(tree);
|
||||
free(tree);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
3
patch.c
3
patch.c
@ -520,7 +520,10 @@ static bool apply_patch_content(uint8_t **buf,
|
||||
if (!filestream_read_file(patch_path, &patch_data, &patch_size))
|
||||
return false;
|
||||
if (patch_size < 0)
|
||||
{
|
||||
free(patch_data);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!path_file_exists(patch_path))
|
||||
{
|
||||
|
@ -191,7 +191,10 @@ static int detect_ps1_game_sub(const char *track_path,
|
||||
tmp += *tmp;
|
||||
}
|
||||
if(tmp >= (buffer + 2048 * 2))
|
||||
{
|
||||
filestream_close(fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
cd_sector = tmp[2] | (tmp[3] << 8) | (tmp[4] << 16);
|
||||
filestream_seek(fp, 13 + skip + cd_sector * frame_size, SEEK_SET);
|
||||
|
Loading…
x
Reference in New Issue
Block a user