src/events/SDL_mouse.c
changeset 9334 5eb5ab33286e
parent 9257 6f41196c2d6b
child 9448 3d3ed3a5ba8d
     1.1 --- a/src/events/SDL_mouse.c	Sat Feb 07 22:40:36 2015 +0100
     1.2 +++ b/src/events/SDL_mouse.c	Sun Feb 08 21:25:37 2015 +0100
     1.3 @@ -303,10 +303,11 @@
     1.4  {
     1.5      if (button >= mouse->num_clickstates) {
     1.6          int i, count = button + 1;
     1.7 -        mouse->clickstate = (SDL_MouseClickState *)SDL_realloc(mouse->clickstate, count * sizeof(*mouse->clickstate));
     1.8 -        if (!mouse->clickstate) {
     1.9 +        SDL_MouseClickState *clickstate = (SDL_MouseClickState *)SDL_realloc(mouse->clickstate, count * sizeof(*mouse->clickstate));
    1.10 +        if (!clickstate) {
    1.11              return NULL;
    1.12          }
    1.13 +        mouse->clickstate = clickstate;
    1.14  
    1.15          for (i = mouse->num_clickstates; i < count; ++i) {
    1.16              SDL_zero(mouse->clickstate[i]);