jpeg pushed a commit to branch master.

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

commit b1f1cd14c21948ba8a6b629ff8c686f68f891897
Author: Alok Mishra <[email protected]>
Date:   Mon Jan 2 15:14:13 2017 +0900

    elm_config: fix for dereferencing after comparing to NULL
    
    Summary:
    arr has been checked earlier so as to avoid when it is NULL.
    If there is a possibility of being NULL earlier
    then it should be checked even when freeing.
    So added the NULL check before free.
    
    @fix
    
    Reviewers: singh.amitesh, bu5hm4n, tasn, cedric, raster, atulfokk, 
hyunseok, minkyu, Hermet, jpeg
    
    Reviewed By: jpeg
    
    Subscribers: cedric, jpeg
    
    Differential Revision: https://phab.enlightenment.org/D4537
---
 src/lib/elementary/elm_config.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 0af9d58..c6cb7b5 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -4191,8 +4191,11 @@ _elm_config_accel_preference_parse(const char *pref, 
Eina_Stringshare **accel,
    DBG("gl depth: %d", *gl_depth);
    DBG("gl stencil: %d", *gl_stencil);
    DBG("gl msaa: %d", *gl_msaa);
-   free(arr[0]);
-   free(arr);
+   if (arr)
+     {
+        free(arr[0]);
+        free(arr);
+     }
 
    return is_hw_accel;
 }

-- 


Reply via email to