summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2014-12-12 04:05:36 +0100
committerCedric BAIL <cedric@osg.samsung.com>2014-12-12 04:05:40 +0100
commit4c1b5a5e30d36429ed5b0a08b515811f47dd79b9 (patch)
tree69bf885a332e18710adbe288e0645d1e5dbf8d12 /src/lib
parentf3e342b5ba141d86a4b91a2948b399ee252dce4a (diff)
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 <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore_ipc/ecore_ipc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c
index 8b9cb2979b..78f725a3aa 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
1275 } 1275 }
1276 if ((max < 0) || (msg.size <= max)) 1276 if ((max < 0) || (msg.size <= max))
1277 { 1277 {
1278 Eina_Bool need_free = EINA_FALSE;
1278 if (msg.size > 0) 1279 if (msg.size > 0)
1279 { 1280 {
1280 buf = malloc(msg.size); 1281 buf = malloc(msg.size);
1281 if (!buf) return ECORE_CALLBACK_CANCEL; 1282 if (!buf) return ECORE_CALLBACK_CANCEL;
1282 memcpy(buf, cl->buf + offset + s, msg.size); 1283 memcpy(buf, cl->buf + offset + s, msg.size);
1284 need_free = EINA_TRUE;
1283 } 1285 }
1284 if (!cl->delete_me) 1286 if (!cl->delete_me)
1285 { 1287 {
@@ -1298,8 +1300,10 @@ _ecore_ipc_event_client_data(void *data EINA_UNUSED, int ev_type EINA_UNUSED, vo
1298 ecore_event_add(ECORE_IPC_EVENT_CLIENT_DATA, e2, 1300 ecore_event_add(ECORE_IPC_EVENT_CLIENT_DATA, e2,
1299 _ecore_ipc_event_client_data_free, 1301 _ecore_ipc_event_client_data_free,
1300 NULL); 1302 NULL);
1303 need_free = EINA_FALSE;
1301 } 1304 }
1302 } 1305 }
1306 if (need_free) free(buf);
1303 } 1307 }
1304 cl->prev.i = msg; 1308 cl->prev.i = msg;
1305 offset += (s + msg.size); 1309 offset += (s + msg.size);