summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-11-28 17:17:09 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-11-28 17:17:09 +0900
commit403e97ecb08392cb7376cef024f4fff480efcff3 (patch)
treeecc3057e3366349a063cc9aad78ea14b5fe7b9c9
parentd2c5a37f3778b2c984eaf92b2b8489078143224a (diff)
ecore_ipc: prevent a double free.
According to clang static analyzer it is possible to find a path where buf and svr->buf are pointing to the same array, better be safe than sorry. Arguably this code could be more readable if it was using Eina_Binbuf.
-rw-r--r--src/lib/ecore_ipc/ecore_ipc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c
index 8b71783f5..8b9cb2979 100644
--- a/src/lib/ecore_ipc/ecore_ipc.c
+++ b/src/lib/ecore_ipc/ecore_ipc.c
@@ -1517,7 +1517,7 @@ _ecore_ipc_event_server_data(void *data EINA_UNUSED, int ev_type EINA_UNUSED, vo
else
{
scroll:
- if (buf) free(buf);
+ if (buf != svr->buf) free(buf);
buf = malloc(svr->buf_size - offset);
if (!buf)
{