From 6e48e9094ea5acd51244ff8b6d73b45ba2d2158f Mon Sep 17 00:00:00 2001 From: Alok Mishra Date: Mon, 19 Sep 2016 15:13:00 +0530 Subject: [PATCH] elm_config: SVACE fix for dereferencing after comparing to NULL arr has been checked earlier so as to avoid when it is NULL. SVACE complains 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 Change-Id: Idb82aa557e3b08890a1496200ee282db9552c1dd Signed-off-by: Alok Mishra --- src/lib/elm_config.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c index fcd91d6..946153d 100644 --- a/src/lib/elm_config.c +++ b/src/lib/elm_config.c @@ -4046,8 +4046,11 @@ elm_config_accel_preference_set(const char *pref) DBG("gl depth: %d", _elm_config->gl_depth); DBG("gl stencil: %d", _elm_config->gl_stencil); DBG("gl msaa: %d", _elm_config->gl_msaa); - free(arr[0]); - free(arr); + if (arr) + { + free(arr[0]); + free(arr); + } if (is_hw_accel == EINA_FALSE) { -- 2.7.4