ecore-wl2: Check the return value of ecore_main_fd_handler_fd_get

This patch fixes an issue where ecore_main_fd_handler_fd_get could be
returning a negative number and passing that to close() which cannot
accept negative numbers.

Fixes Coverity CID1357152

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This commit is contained in:
Chris Michael 2016-06-30 11:05:14 -04:00
parent 0da58a8d78
commit 35f76fe8a8
1 changed files with 5 additions and 1 deletions

View File

@ -449,7 +449,11 @@ _ecore_wl2_dnd_del(Ecore_Wl2_Dnd_Source *source)
if (!source) return;
if (source->fdh)
{
close(ecore_main_fd_handler_fd_get(source->fdh));
int fd;
fd = ecore_main_fd_handler_fd_get(source->fdh);
if (fd >= 0)
close(ecore_main_fd_handler_fd_get(source->fdh));
ecore_main_fd_handler_del(source->fdh);
}
wl_data_offer_destroy(source->offer);