From 9fbe26998b42ad55301d012c3d7df2898d6283b8 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 30 Mar 2020 14:34:41 -0400 Subject: [PATCH] ecore_evas_wayland: Do not pass negative parameter to close function Coverity reports that 'fd' here is negative, and close() cannot accept a negative parameter, so add a check to make sure 'fd' is not negative before passing to close function. Fixes CID1420318 --- .../ecore_evas/engines/wayland/ecore_evas_wayland_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index 2fd027cb14..67ff8931a9 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -2624,7 +2624,7 @@ end: ecore_main_fd_handler_del(fd_handler); free(slice->slice.mem); free(slice); - close(fd); + if (fd > -1) close(fd); return EINA_FALSE; } }