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