discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=6007a51f17420194b7179db4fd55c9086ece06e5

commit 6007a51f17420194b7179db4fd55c9086ece06e5
Author: Derek Foreman <der...@osg.samsung.com>
Date:   Thu Mar 31 13:08:38 2016 -0500

    wayland: Don't leak a clipboard source if adding fd handler fails
    
    Reviewed-by: Mike Blumenkrantz <zm...@osg.samsung.com>
---
 src/bin/e_comp_wl_data.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/bin/e_comp_wl_data.c b/src/bin/e_comp_wl_data.c
index d71d3aa..8183a96 100644
--- a/src/bin/e_comp_wl_data.c
+++ b/src/bin/e_comp_wl_data.c
@@ -940,7 +940,12 @@ e_comp_wl_clipboard_source_create(const char *mime_type, 
uint32_t serial, int fd
           ecore_main_fd_handler_add(fd, ECORE_FD_READ,
                                     _e_comp_wl_clipboard_source_save,
                                     e_comp->wl_comp_data, NULL, NULL);
-        if (!source->fd_handler) return NULL;
+        if (!source->fd_handler)
+          {
+             _mime_types_free(&source->data_source);
+             free(source);
+             return NULL;
+          }
      }
 
    source->fd = fd;

-- 


Reply via email to