mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-01-05 04:47:50 +00:00
sysjoystick: don't leak fd on error
This commit is contained in:
committed by
Ryan C. Gordon
parent
9a802797d2
commit
a44107540d
@@ -1518,6 +1518,7 @@ static SDL_sensorlist_item *GetSensor(SDL_joylist_item *item)
|
||||
return NULL;
|
||||
}
|
||||
if (ioctl(fd_item, EVIOCGUNIQ(sizeof(uniq_item) - 1), &uniq_item) < 0) {
|
||||
close(fd_item);
|
||||
return NULL;
|
||||
}
|
||||
close(fd_item);
|
||||
|
||||
Reference in New Issue
Block a user