mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
Prevent static code analyzer complaining about potential
memory leaks
This commit is contained in:
parent
6318e11027
commit
672deef31a
1 changed files with 6 additions and 2 deletions
|
@ -532,7 +532,9 @@ int64_t filestream_read_file(const char *path, void **buf, int64_t *len)
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
filestream_close(file);
|
if (filestream_close(file) != 0)
|
||||||
|
if (file)
|
||||||
|
free(file);
|
||||||
|
|
||||||
*buf = content_buf;
|
*buf = content_buf;
|
||||||
|
|
||||||
|
@ -576,7 +578,9 @@ bool filestream_write_file(const char *path, const void *data, int64_t size)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ret = filestream_write(file, data, size);
|
ret = filestream_write(file, data, size);
|
||||||
filestream_close(file);
|
if (filestream_close(file) != 0)
|
||||||
|
if (file)
|
||||||
|
free(file);
|
||||||
|
|
||||||
if (ret != size)
|
if (ret != size)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue