forked from enlightenment/efl
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:
parent
9caa31357c
commit
8ff8aa3076
|
@ -5517,7 +5517,11 @@ evgl_glShaderSource(GLuint shader, GLsizei count, const char* const* string, con
|
||||||
char **s = malloc(count * sizeof(char*));
|
char **s = malloc(count * sizeof(char*));
|
||||||
if (!s) goto err;
|
if (!s) goto err;
|
||||||
GLint *l = malloc(count * sizeof(GLint));
|
GLint *l = malloc(count * sizeof(GLint));
|
||||||
if (!l) goto err;
|
if (!l)
|
||||||
|
{
|
||||||
|
free(s);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
memset(s, 0, count * sizeof(char*));
|
memset(s, 0, count * sizeof(char*));
|
||||||
memset(l, 0, count * sizeof(GLint));
|
memset(l, 0, count * sizeof(GLint));
|
||||||
|
|
Loading…
Reference in New Issue