shader_glsl: Fix potential memory leaks

This commit is contained in:
Lioncash 2014-10-26 12:44:33 -04:00
parent 8e12c7811c
commit 4f7b762ece

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