Evas: Free variable in error path

Fixes CID 1270032
  Resource leaks  (RESOURCE_LEAK)
  Variable "exim" going out of scope leaks the storage it points to.
This commit is contained in:
Jean-Philippe Andre 2015-02-13 11:06:25 +09:00
parent 38f1f9c5f2
commit 968751f835
1 changed files with 4 additions and 3 deletions

View File

@ -86,16 +86,17 @@ evas_xlib_image_native_set(void *data, void *image, void *native)
w = im->cache_entry.w;
h = im->cache_entry.h;
n = calloc(1, sizeof(Native));
if (!n) return NULL;
exim = ecore_x_image_new(w, h, vis, depth);
if (!exim)
{
ERR("ecore_x_image_new failed.");
free(n);
return NULL;
}
n = calloc(1, sizeof(Native));
if (!n) return NULL;
memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
n->pixmap = pm;
n->visual = vis;