[PATCH] dinput: 0 is a valid fd (Coverity)

Marcus Meissner marcus at jet.franken.de
Mon Aug 22 16:19:41 CDT 2016


1371727 Resource leak
(will not happen in Wine, but it is valid)

Signed-off-by: Marcus Meissner <marcus at jet.franken.de>
---
 dlls/dinput/joystick_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c
index 3086e68..39e3d7a 100644
--- a/dlls/dinput/joystick_linux.c
+++ b/dlls/dinput/joystick_linux.c
@@ -151,7 +151,7 @@ static BOOL read_sys_id_variable(int index, const char *property, WORD *value)
 
     sprintf(sys_path, SYS_PATH_FORMAT, index, property);
     sys_fd = open(sys_path, O_RDONLY);
-    if (sys_fd > 0)
+    if (sys_fd >= 0)
     {
         if (read(sys_fd, id_str, 4) == 4)
         {
-- 
2.9.3




More information about the wine-patches mailing list