stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8ff8aa3076fe319f891c5bd5fdc972c7c1e45451

commit 8ff8aa3076fe319f891c5bd5fdc972c7c1e45451
Author: Stefan Schmidt <[email protected]>
Date:   Tue Feb 25 10:57:24 2020 +0100

    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 <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D11409
---
 src/modules/evas/engines/software_generic/evas_engine.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/modules/evas/engines/software_generic/evas_engine.c 
b/src/modules/evas/engines/software_generic/evas_engine.c
index d2f0381732..674e698bc2 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -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));

-- 


Reply via email to