mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-14 22:38:34 +00:00
Prevent some heap corruptions/exceptions
This commit is contained in:
parent
93561a042b
commit
6a47669d21
@ -22,7 +22,8 @@ FILE* fopen_utf8(const char * filename, const char * mode)
|
||||
if (!filename_local)
|
||||
return NULL;
|
||||
ret = fopen(filename_local, mode);
|
||||
free(filename_local);
|
||||
if (filename_local)
|
||||
free(filename_local);
|
||||
return ret;
|
||||
#else
|
||||
wchar_t * filename_w = utf8_to_utf16_string_alloc(filename);
|
||||
|
@ -1220,7 +1220,7 @@ bool rpng_set_buf_ptr(rpng_t *rpng, void *data)
|
||||
|
||||
rpng_t *rpng_alloc(void)
|
||||
{
|
||||
rpng_t *rpng = (rpng_t*)calloc(1, sizeof(rpng_t));
|
||||
rpng_t *rpng = (rpng_t*)calloc(1, sizeof(*rpng));
|
||||
if (!rpng)
|
||||
return NULL;
|
||||
return rpng;
|
||||
|
@ -69,7 +69,8 @@ static void zlib_inflate_stream_free(void *data)
|
||||
return;
|
||||
if (z->inited)
|
||||
inflateEnd(&z->z);
|
||||
free(z);
|
||||
if (z)
|
||||
free(z);
|
||||
}
|
||||
|
||||
static bool zlib_deflate_define(void *data, const char *prop, uint32_t val)
|
||||
|
@ -3893,7 +3893,8 @@ static void xmb_context_reset(void *data, bool is_threaded)
|
||||
xmb_update_thumbnail_image(xmb);
|
||||
xmb_update_savestate_thumbnail_image(xmb);
|
||||
|
||||
free(iconpath);
|
||||
if (iconpath)
|
||||
free(iconpath);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user