From: Carsten Haitzler (Rasterman) Date: Wed, 17 May 2017 05:53:22 +0000 (+0900) Subject: edje_cc - use mem_alloc to fail and exit if alloc fails and fix err out X-Git-Tag: upstream/1.20.0~1034 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0feb34927bfbbb39efb5edf103202b10eeea0c31;p=platform%2Fupstream%2Fefl.git edje_cc - use mem_alloc to fail and exit if alloc fails and fix err out PVS sudio thought this was odd and it was a bit. not a real issue as a mem alloc failure herw would still be fatal and simply a crash... as opposed to a clean "out of mem" and fatal exit then... error out eally was not finding originally allocated color and the malloc should have been a mem_alloc() that guarantees a valid memory return (or termintion of the process). @fix --- diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 798857b..bbffeca 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -8034,7 +8034,7 @@ _copied_map_colors_get(Edje_Part_Description_Common *parent) int i; if (parent->map.colors_count == 0) return NULL; - colors = malloc(sizeof(Edje_Map_Color *) * parent->map.colors_count); + colors = mem_alloc(sizeof(Edje_Map_Color *) * parent->map.colors_count); for (i = 0; i < (int)parent->map.colors_count; i++) { @@ -8043,7 +8043,7 @@ _copied_map_colors_get(Edje_Part_Description_Common *parent) Edje_Map_Color *c = mem_alloc(SZ(Edje_Map_Color)); if (!color) { - ERR("not enough memory"); + ERR("Could not find allocated source when copying map colors"); exit(-1); return NULL; }