devilhorns pushed a commit to branch master.

commit a01ce5e409aa6b96f36af4e7a5ebbb95fb8335cb
Author: Chris Michael <[email protected]>
Date:   Mon Jul 8 12:30:34 2013 +0100

    Fix memleak of window_prop_property_get
    
    NB: Fixes Coverity CID1039273
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/lib/ecore_x/xlib/ecore_x_e.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_x/xlib/ecore_x_e.c b/src/lib/ecore_x/xlib/ecore_x_e.c
index 4d22484..93e1ebe 100644
--- a/src/lib/ecore_x/xlib/ecore_x_e.c
+++ b/src/lib/ecore_x/xlib/ecore_x_e.c
@@ -1243,7 +1243,10 @@ ecore_x_e_window_profile_get(Ecore_X_Window win)
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
    if (!ecore_x_window_prop_property_get(win, ECORE_X_ATOM_E_WINDOW_PROFILE,
                                          XA_ATOM, 32, &data, &num))
-     return NULL;
+     {
+        if (data) free(data);
+        return NULL;
+     }
 
    if (data)
      atom = (Ecore_X_Atom *)data;
@@ -1251,6 +1254,8 @@ ecore_x_e_window_profile_get(Ecore_X_Window win)
    if (atom)
      profile = ecore_x_atom_name_get(atom[0]);
 
+   if (data) free(data);
+
    return profile;
 }
 

-- 

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

Build for Windows Store.

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

Reply via email to