devilhorns pushed a commit to branch master.
commit aedff2dc317cfde6eeff96c9922f77074c191e07
Author: Chris Michael <[email protected]>
Date: Mon Jul 8 12:48:35 2013 +0100
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 <[email protected]>
---
src/lib/ecore_ipc/ecore_ipc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c
index a53d35d..9ee22cf 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
Ecore_Ipc_Event_Server_Data *e2;
int max;
+ if (buf) free(buf);
buf = NULL;
max = svr->max_buf_size;
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
free(svr->buf);
svr->buf = NULL;
svr->buf_size = 0;
+ if (buf) free(buf);
return ECORE_CALLBACK_CANCEL;
}
goto redo;
@@ -1513,6 +1515,7 @@ _ecore_ipc_event_server_data(void *data EINA_UNUSED, int
ev_type EINA_UNUSED, vo
else
{
scroll:
+ if (buf) free(buf);
buf = malloc(svr->buf_size - offset);
if (!buf)
{
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev