mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +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));
|
||||
if (!glsl->glsl_shader)
|
||||
{
|
||||
free(glsl);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (path)
|
||||
{
|
||||
@ -765,6 +768,8 @@ static bool gl_glsl_init(void *data, const char *path)
|
||||
if (!ret)
|
||||
{
|
||||
RARCH_ERR("[GL]: Failed to parse GLSL shader.\n");
|
||||
free(glsl->glsl_shader);
|
||||
free(glsl);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user