diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c index 1ababa62e..7071cc50b 100644 --- a/src/haptic/linux/SDL_syshaptic.c +++ b/src/haptic/linux/SDL_syshaptic.c @@ -390,8 +390,8 @@ SDL_SYS_HapticName(int index) /* No name found, return device character device */ name = item->fname; } + close(fd); } - close(fd); return name; }