From: Stefan Schmidt Date: Tue, 25 Feb 2020 09:57:24 +0000 (+0100) Subject: evas: software_engine: free allocation on error path X-Git-Tag: submit/tizen/20200303.214157~87 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db39a5b61d79fc48e3691f3cc720f59be3fcc1fe;p=platform%2Fupstream%2Fefl.git 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 Differential Revision: https://phab.enlightenment.org/D11409 Change-Id: I4016c7bab0347519e03345f4bb46d16377479dc4 --- diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index d1e19c6..1b79f5a 100755 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -5597,7 +5597,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));