wayland: Don't leak a clipboard source if adding fd handler fails

Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
This commit is contained in:
Derek Foreman 2016-03-31 13:08:38 -05:00 committed by Mike Blumenkrantz
parent 2bf2772712
commit 6007a51f17
1 changed files with 6 additions and 1 deletions

View File

@ -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;