From a59315ed6adf3bec16e44a07801b2613786756f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Thu, 13 Dec 2018 20:29:50 +0100 Subject: [PATCH] Win32: Fix joystick element info memory leak The array was freed on failure but not on success. Fixes #1396. --- src/win32_joystick.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/win32_joystick.c b/src/win32_joystick.c index d9d341ff..58123965 100644 --- a/src/win32_joystick.c +++ b/src/win32_joystick.c @@ -260,6 +260,8 @@ static void closeJoystick(_GLFWjoystick* js) IDirectInputDevice8_Release(js->win32.device); } + free(js->win32.objects); + _glfwFreeJoystick(js); _glfwInputJoystick(js, GLFW_DISCONNECTED); }