evas: software_engine: free allocation on error path

When we allocated s but fail to allocate l we need to make sure to free
the first allocation before erroring out.

CID: 1419874

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11409
This commit is contained in:
Stefan Schmidt 2020-02-25 10:57:24 +01:00
parent 9caa31357c
commit 8ff8aa3076
1 changed files with 5 additions and 1 deletions

View File

@ -5517,7 +5517,11 @@ evgl_glShaderSource(GLuint shader, GLsizei count, const char* const* string, con
char **s = malloc(count * sizeof(char*));
if (!s) goto err;
GLint *l = malloc(count * sizeof(GLint));
if (!l) goto err;
if (!l)
{
free(s);
goto err;
}
memset(s, 0, count * sizeof(char*));
memset(l, 0, count * sizeof(GLint));