summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-07-09 16:02:40 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-07-09 16:04:22 +0100
commitf850cf6a00c1fe205fa7ebdfdd78318f48b58213 (patch)
tree8a6809773c5d156a801e592933e3afe9f3c64d3a
parent244b1446fc487b6254e02a180e44a3d67b197b44 (diff)
edje - double make sure edje messages are zero'd due to a segv i saw
i saw a segv on freeing em->msg as it was a junk ptr... i dont know for sure it msg was properly initted but as em is recycled from trash be sure and zero it when digging out of trash because em->msg was not a valid ptr (and i wasnt using valgrind at the time to know for sure and cant find this with valgrind now). @fix
-rw-r--r--src/lib/edje/edje_message_queue.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/edje/edje_message_queue.c b/src/lib/edje/edje_message_queue.c
index ea3adc824a..020f89b46d 100644
--- a/src/lib/edje/edje_message_queue.c
+++ b/src/lib/edje/edje_message_queue.c
@@ -354,13 +354,14 @@ _edje_message_new(Edje *ed, Edje_Queue queue, Edje_Message_Type type, int id)
354 Edje_Message *em; 354 Edje_Message *em;
355 355
356 em = _edje_msg_trash_pop(); 356 em = _edje_msg_trash_pop();
357 if (!em) em = calloc(1, sizeof(Edje_Message)); 357 if (em) memset(em, 0, sizeof(Edje_Message));
358 else em = calloc(1, sizeof(Edje_Message));
358 if (!em) return NULL; 359 if (!em) return NULL;
359 em->edje = ed; 360 em->edje = ed;
361 em->edje->message.num++;
360 em->queue = queue; 362 em->queue = queue;
361 em->type = type; 363 em->type = type;
362 em->id = id; 364 em->id = id;
363 em->edje->message.num++;
364 return em; 365 return em;
365} 366}
366 367