devilhorns pushed a commit to branch master.

commit 0d12ab48bee07e75201bb3cbb2b87bb4a8f958a6
Author: Chris Michael <[email protected]>
Date:   Mon Jul 8 12:24:21 2013 +0100

    Fix memleak spotted by Coverity: ecore_x_window_prop_property_get can
    allocate space for 'data'. If we return before using it, then free
    'data'. If we use it later for XGetAtomName, then we can free if After
    we have gotten the atom names and sent the event. (NB: XGetAtomName
    will allocate it's own space for the returned name, so this is safe).
    
    NB: Fixes Coverity CID1039271
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_x/xlib/ecore_x_events.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lib/ecore_x/xlib/ecore_x_events.c 
b/src/lib/ecore_x/xlib/ecore_x_events.c
index 5519d25..2367a69 100644
--- a/src/lib/ecore_x/xlib/ecore_x_events.c
+++ b/src/lib/ecore_x/xlib/ecore_x_events.c
@@ -1556,6 +1556,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
                {
                   WRN(
                     "DND: Could not fetch data type list from source window, 
aborting.");
+                  if (data) free(data);
                   free(e);
                   return;
                }
@@ -1594,6 +1595,8 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
         e->source = target->source;
         ecore_event_add(ECORE_X_EVENT_XDND_ENTER, e,
                         _ecore_x_event_free_xdnd_enter, NULL);
+
+        if (data) free(data);
      }
    /* Message Type: XdndPosition target */
    else if (xevent->xclient.message_type == ECORE_X_ATOM_XDND_POSITION)

-- 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Reply via email to