cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4c1b5a5e30d36429ed5b0a08b515811f47dd79b9
commit 4c1b5a5e30d36429ed5b0a08b515811f47dd79b9 Author: Shinwoo Kim <[email protected]> Date: Fri Dec 12 04:05:36 2014 +0100 ecore_ipc: coverity issue - you cannot return without free Summary: The allocated memory is not released before return. Lost track of the CID. Test Plan: Run static analysis tool such as prevent Reviewers: raster, cedric Reviewed By: cedric Subscribers: cedric, seoz Differential Revision: https://phab.enlightenment.org/D1746 Signed-off-by: Cedric BAIL <[email protected]> --- src/lib/ecore_ipc/ecore_ipc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c index 8b9cb29..78f725a 100644 --- a/src/lib/ecore_ipc/ecore_ipc.c +++ b/src/lib/ecore_ipc/ecore_ipc.c @@ -1275,11 +1275,13 @@ _ecore_ipc_event_client_data(void *data EINA_UNUSED, int ev_type EINA_UNUSED, vo } if ((max < 0) || (msg.size <= max)) { + Eina_Bool need_free = EINA_FALSE; if (msg.size > 0) { buf = malloc(msg.size); if (!buf) return ECORE_CALLBACK_CANCEL; memcpy(buf, cl->buf + offset + s, msg.size); + need_free = EINA_TRUE; } if (!cl->delete_me) { @@ -1298,8 +1300,10 @@ _ecore_ipc_event_client_data(void *data EINA_UNUSED, int ev_type EINA_UNUSED, vo ecore_event_add(ECORE_IPC_EVENT_CLIENT_DATA, e2, _ecore_ipc_event_client_data_free, NULL); + need_free = EINA_FALSE; } } + if (need_free) free(buf); } cl->prev.i = msg; offset += (s + msg.size); --
