iOS: Fixed pointer dereference after free.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Mon, 21 Sep 2015 21:19:37 +0200
changeset 987863f03a567fe3
parent 9877 e6fa7403893b
child 9879 8465a79c9f85
iOS: Fixed pointer dereference after free.
src/joystick/iphoneos/SDL_sysjoystick.m
     1.1 --- a/src/joystick/iphoneos/SDL_sysjoystick.m	Mon Sep 21 21:16:54 2015 +0200
     1.2 +++ b/src/joystick/iphoneos/SDL_sysjoystick.m	Mon Sep 21 21:19:37 2015 +0200
     1.3 @@ -228,9 +228,6 @@
     1.4      }
     1.5  #endif /* SDL_JOYSTICK_MFI */
     1.6  
     1.7 -    SDL_free(device->name);
     1.8 -    SDL_free(device);
     1.9 -
    1.10      --numjoysticks;
    1.11  
    1.12  #if !SDL_EVENTS_DISABLED
    1.13 @@ -245,6 +242,9 @@
    1.14      }
    1.15  #endif /* !SDL_EVENTS_DISABLED */
    1.16  
    1.17 +    SDL_free(device->name);
    1.18 +    SDL_free(device);
    1.19 +
    1.20      return next;
    1.21  }
    1.22