mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
shader_glsl: Fix potential memory leaks
This commit is contained in:
parent
8e12c7811c
commit
4f7b762ece
@ -735,7 +735,10 @@ static bool gl_glsl_init(void *data, const char *path)
|
|||||||
|
|
||||||
glsl->glsl_shader = (struct gfx_shader*)calloc(1, sizeof(*glsl->glsl_shader));
|
glsl->glsl_shader = (struct gfx_shader*)calloc(1, sizeof(*glsl->glsl_shader));
|
||||||
if (!glsl->glsl_shader)
|
if (!glsl->glsl_shader)
|
||||||
|
{
|
||||||
|
free(glsl);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (path)
|
if (path)
|
||||||
{
|
{
|
||||||
@ -765,6 +768,8 @@ static bool gl_glsl_init(void *data, const char *path)
|
|||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
RARCH_ERR("[GL]: Failed to parse GLSL shader.\n");
|
RARCH_ERR("[GL]: Failed to parse GLSL shader.\n");
|
||||||
|
free(glsl->glsl_shader);
|
||||||
|
free(glsl);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user