Merge pull request #1203 from lioncash/glsl-leak

shader_glsl: Fix potential memory leaks
This commit is contained in:
Twinaphex 2014-10-26 17:50:43 +01:00
commit 3826a3d3e9

View File

@ -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;
}
}