devilhorns pushed a commit to branch master.

commit 964f4769ae02287f7f1096b2dde31c958a252b8a
Author: Chris Michael <[email protected]>
Date:   Wed May 29 13:24:49 2013 +0100

    Fix potential memleak reported by klockwork.
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_wayland/ecore_wl_dnd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_wayland/ecore_wl_dnd.c 
b/src/lib/ecore_wayland/ecore_wl_dnd.c
index 444e1e1..f5849dc 100644
--- a/src/lib/ecore_wayland/ecore_wl_dnd.c
+++ b/src/lib/ecore_wayland/ecore_wl_dnd.c
@@ -620,7 +620,11 @@ _ecore_wl_dnd_selection_data_read(void *data, 
Ecore_Fd_Handler *fd_handler EINA_
    else
      {
         event->data = malloc(len + 1);
-        if (!event->data) return ECORE_CALLBACK_CANCEL;
+        if (!event->data)
+          {
+             free(event);
+             return ECORE_CALLBACK_CANCEL;
+          }
         strncpy(event->data, buffer, len);
         event->data[len] = '\0';
         event->len = len;

-- 

------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1

Reply via email to