diff options
author | Alok Mishra <alok.mishra@samsung.com> | 2017-01-02 15:14:13 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-01-02 15:14:13 +0900 |
commit | b1f1cd14c21948ba8a6b629ff8c686f68f891897 (patch) | |
tree | 1d2e5f1dd6dfc5f6b05db5b284b157207e445703 | |
parent | 9bdaf07d6ec740a92077af17bddbb914898cd315 (diff) | |
download | efl-b1f1cd14c21948ba8a6b629ff8c686f68f891897.tar.gz |
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
-rw-r--r-- | src/lib/elementary/elm_config.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c index 0af9d58b90..c6cb7b5374 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; } |