From d7600cfbee39833bfff52784684300c3f760c202 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 8 Jul 2013 12:34:28 +0100 Subject: [PATCH] Fix memleak of window_prop_property_get NB: Fixes Coverity CID1039274 Signed-off-by: Chris Michael --- src/lib/ecore_x/xlib/ecore_x_dnd.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_x/xlib/ecore_x_dnd.c b/src/lib/ecore_x/xlib/ecore_x_dnd.c index d44dc4fc47..f1200172f1 100644 --- a/src/lib/ecore_x/xlib/ecore_x_dnd.c +++ b/src/lib/ecore_x/xlib/ecore_x_dnd.c @@ -201,12 +201,19 @@ ecore_x_dnd_version_get(Ecore_X_Window win) t = realloc(_version_cache, _version_cache_alloc * sizeof(Version_Cache_Item)); - if (!t) return 0; + if (!t) + { + if (prop_data) free(prop_data); + return 0; + } + _version_cache = t; _version_cache[_version_cache_num - 1].win = win; _version_cache[_version_cache_num - 1].ver = 0; } + if (prop_data) free(prop_data); + return 0; }