raster pushed a commit to branch master.

commit 59ea842b22d14be0ccb568e6662f62635229ab95
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Tue Jul 16 18:58:20 2013 +0900

    fix clang bad free better. :)
---
 src/lib/ecore_ipc/ecore_ipc.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c
index fb1187d..03be3cf 100644
--- a/src/lib/ecore_ipc/ecore_ipc.c
+++ b/src/lib/ecore_ipc/ecore_ipc.c
@@ -1467,8 +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);
-                  if (buf == svr->buf) svr->buf = NULL;
+                  if (buf != svr->buf) free(buf);
                   buf = NULL;
                   max = svr->max_buf_size;
                   if ((max < 0) || (msg.size <= max))
@@ -1503,6 +1502,16 @@ _ecore_ipc_event_server_data(void *data EINA_UNUSED, int 
ev_type EINA_UNUSED, vo
                                                  
_ecore_ipc_event_server_data_free,
                                                  NULL);
                               }
+                            else
+                              {
+                                 free(buf);
+                                 buf = NULL;
+                              }
+                         }
+                       else
+                         {
+                            free(buf);
+                            buf = NULL;
                          }
                     }
                   svr->prev.i = msg;

-- 

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

Reply via email to