ecore_x: No need to free NULL value.
authorAmitesh Singh <amitesh.sh@samsung.com>
Mon, 22 Sep 2014 17:42:36 +0000 (13:42 -0400)
committerChris Michael <cp.michael@samsung.com>
Mon, 22 Sep 2014 17:43:10 +0000 (13:43 -0400)
NB: This reintroduces the Coverity Resouce Leak detected with CID1039276

Summary:
When ecore_x_window_prop_property_get returns 0, data is already NULL hence
no need to free NULL value. This fault was introduced in 45a2296218b0f297
while fixing coverity defects.

Reviewers: seoz, cedric, raster, devilhorns

Subscribers: cedric, seoz

Differential Revision: https://phab.enlightenment.org/D1473

src/lib/ecore_x/xlib/ecore_x_dnd.c

index 8bbbab4..cd2ec14 100644 (file)
@@ -230,10 +230,7 @@ ecore_x_dnd_type_isset(Ecore_X_Window win,
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
    if (!ecore_x_window_prop_property_get(win, ECORE_X_ATOM_XDND_TYPE_LIST,
                                          XA_ATOM, 32, &data, &num))
-     {
-        if (data) free(data);
-        return ret;
-     }
+     return ret;
 
    atom = ecore_x_atom_get(type);
    atoms = (Ecore_X_Atom *)data;