sysjoystick: don't leak fd on error

This commit is contained in:
Wim Taymans authored and Ryan C. Gordon committed 2025-02-27 19:49:46 -05:00
1 parent 9a802797d2
commit a44107540d
1 file changed
+1
+1
View File
@@ -1518,6 +1518,7 @@ static SDL_sensorlist_item *GetSensor(SDL_joylist_item *item)
return NULL; return NULL;
} }
if (ioctl(fd_item, EVIOCGUNIQ(sizeof(uniq_item) - 1), &uniq_item) < 0) { if (ioctl(fd_item, EVIOCGUNIQ(sizeof(uniq_item) - 1), &uniq_item) < 0) {
close(fd_item);
return NULL; return NULL;
} }
close(fd_item); close(fd_item);