From e54fd09c34ab3580736cf1205c5c1edb621a65b8 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Fri, 9 Oct 2015 12:29:41 +0100 Subject: [PATCH] Edje cc handlers: Fix memory leak and possible crash. Due to a misplaced semicolon, EINA_LIST_FREE was doing nothing and only the last part was freed if there was one, and probably a crash if there wasn't. This shows again that having statements without {} is dangerous. We need to force {} and add a lint rule, or at the very least, add a rule to put the ; in a new line (like clang warns about by default anyway). @fix --- src/bin/edje/edje_cc_handlers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index e75f0cd99d..c214f5b6c1 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -5081,7 +5081,7 @@ _program_free(Edje_Program *pr) free((void*)pr->state2); free((void*)pr->sample_name); free((void*)pr->tone_name); - EINA_LIST_FREE(pr->targets, prt); + EINA_LIST_FREE(pr->targets, prt) free(prt); EINA_LIST_FREE(pr->after, pa) free(pa);