[PATCH] dinput: added a missing close(fd) in disabled case (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Sep 15 13:17:11 CDT 2012


Hi,

had the same fix in joystick_linuxinput.c, now here too.
CID718726

Ciao, Marcus
---
 dlls/dinput/joystick_linux.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c
index ed2498b..a91c5e8 100644
--- a/dlls/dinput/joystick_linux.c
+++ b/dlls/dinput/joystick_linux.c
@@ -158,7 +158,10 @@ static INT find_joystick_devices(void)
         /* Append driver name */
         strcat(joydev.name, JOYDEVDRIVER);
 
-        if (device_disabled_registry(joydev.name)) continue;
+        if (device_disabled_registry(joydev.name)) {
+            close(fd);
+            continue;
+        }
 
 #ifdef JSIOCGAXES
         if (ioctl(fd, JSIOCGAXES, &joydev.axis_count) < 0)
-- 
1.7.3.4




More information about the wine-patches mailing list