From 774b07751314de950b5a635906979b7aa74c3b6f Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Mon, 21 Sep 2015 21:19:37 +0200 Subject: [PATCH] iOS: Fixed pointer dereference after free. --- src/joystick/iphoneos/SDL_sysjoystick.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/joystick/iphoneos/SDL_sysjoystick.m b/src/joystick/iphoneos/SDL_sysjoystick.m index ef63484905e40..e9ad049639448 100644 --- a/src/joystick/iphoneos/SDL_sysjoystick.m +++ b/src/joystick/iphoneos/SDL_sysjoystick.m @@ -228,9 +228,6 @@ } #endif /* SDL_JOYSTICK_MFI */ - SDL_free(device->name); - SDL_free(device); - --numjoysticks; #if !SDL_EVENTS_DISABLED @@ -245,6 +242,9 @@ } #endif /* !SDL_EVENTS_DISABLED */ + SDL_free(device->name); + SDL_free(device); + return next; }