From bb2d7c4250e358622e51540e5c3d74ca39353971 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Thu, 19 Nov 2015 21:02:21 +0100 Subject: [PATCH] options_wallpaper: fix CID 1339835: Null pointer dereference --- src/bin/options_wallpaper.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/bin/options_wallpaper.c b/src/bin/options_wallpaper.c index c9eec9f4..568fad35 100644 --- a/src/bin/options_wallpaper.c +++ b/src/bin/options_wallpaper.c @@ -230,15 +230,18 @@ _rec_read_directorys(Eina_List *list, const char *root_path, item = calloc(1, sizeof(Background_Item)); if (item) { - notify = calloc(1, + notify = calloc(1, sizeof(Insert_Gen_Grid_Item_Notify)); item->path = eina_stringshare_add(path); list = eina_list_append(list, item); - //insert item to gengrid - notify->class = class; - notify->item = item; - //ecore_thread_feedback(th, notify); - _insert_gengrid_item(notify); + if (notify) + { + //insert item to gengrid + notify->class = class; + notify->item = item; + //ecore_thread_feedback(th, notify); + _insert_gengrid_item(notify); + } } break; }