summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-11-17 10:00:19 -0500
committerChris Michael <cp.michael@samsung.com>2015-11-17 10:02:03 -0500
commite29da3ca694d62f9c0049e1d8d65f8f95e6bf455 (patch)
tree9bf59a49939d811a7f6fa68579d94a8ed3e4ccd4
parentd6e0d902cf6e9d9ac91e8af199dd00f6537f3f2f (diff)
evas-software-x11: Fix resource leak
If we end up leaving evas_xlib_image_dri_native_set due to a failure to allocate memory, we should free the previously allocated Evas_DRI_Image so that we don't leak NB: Fixes Coverity CID1339782 @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/modules/evas/engines/software_x11/evas_xlib_dri_image.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c b/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c
index 2c1c72c025..0c0a0ab025 100644
--- a/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c
+++ b/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c
@@ -588,7 +588,10 @@ evas_xlib_image_dri_native_set(void *data, void *image, void *native)
588 588
589 n = calloc(1, sizeof(DRI_Native)); 589 n = calloc(1, sizeof(DRI_Native));
590 if (!n) 590 if (!n)
591 return NULL; 591 {
592 evas_xlib_image_dri_free(exim);
593 return NULL;
594 }
592 595
593 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); 596 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
594 n->pixmap = pm; 597 n->pixmap = pm;