summaryrefslogtreecommitdiff
path: root/src/lib/ecore_ipc
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-07-08 12:48:35 +0100
committerChris Michael <cp.michael@samsung.com>2013-07-08 12:50:38 +0100
commitaedff2dc317cfde6eeff96c9922f77074c191e07 (patch)
tree853d63c455340227abb92c9c2bfc838481782818 /src/lib/ecore_ipc
parentca318c05fdca484012db062add4fd5600ccb3690 (diff)
Fix memleaks reported by Coverity: Setting 'buf' to NULL (without
freeing first) leaks the storage that buf Did point to (which could have been from a realloc above). NB: Fixes Coverity CID1039277, CID1039278 Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_ipc')
-rw-r--r--src/lib/ecore_ipc/ecore_ipc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c
index a53d35d804..9ee22cf281 100644
--- a/src/lib/ecore_ipc/ecore_ipc.c
+++ b/src/lib/ecore_ipc/ecore_ipc.c
@@ -1467,6 +1467,7 @@ _ecore_ipc_event_server_data(void *data EINA_UNUSED, int ev_type EINA_UNUSED, vo
1467 Ecore_Ipc_Event_Server_Data *e2; 1467 Ecore_Ipc_Event_Server_Data *e2;
1468 int max; 1468 int max;
1469 1469
1470 if (buf) free(buf);
1470 buf = NULL; 1471 buf = NULL;
1471 max = svr->max_buf_size; 1472 max = svr->max_buf_size;
1472 if ((max < 0) || (msg.size <= max)) 1473 if ((max < 0) || (msg.size <= max))
@@ -1504,6 +1505,7 @@ _ecore_ipc_event_server_data(void *data EINA_UNUSED, int ev_type EINA_UNUSED, vo
1504 free(svr->buf); 1505 free(svr->buf);
1505 svr->buf = NULL; 1506 svr->buf = NULL;
1506 svr->buf_size = 0; 1507 svr->buf_size = 0;
1508 if (buf) free(buf);
1507 return ECORE_CALLBACK_CANCEL; 1509 return ECORE_CALLBACK_CANCEL;
1508 } 1510 }
1509 goto redo; 1511 goto redo;
@@ -1513,6 +1515,7 @@ _ecore_ipc_event_server_data(void *data EINA_UNUSED, int ev_type EINA_UNUSED, vo
1513 else 1515 else
1514 { 1516 {
1515 scroll: 1517 scroll:
1518 if (buf) free(buf);
1516 buf = malloc(svr->buf_size - offset); 1519 buf = malloc(svr->buf_size - offset);
1517 if (!buf) 1520 if (!buf)
1518 { 1521 {