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
This commit is contained in:
Alok Mishra 2017-01-02 15:14:13 +09:00 committed by Jean-Philippe Andre
parent 9bdaf07d6e
commit b1f1cd14c2
1 changed files with 5 additions and 2 deletions

View File

@ -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;
}