RPI_FreeCursor: set global_cursor to NULL to prevent double-free (bug 4769)
authorOzkan Sezer <sezeroz@gmail.com>
Mon, 26 Aug 2019 18:41:40 +0300
changeset 130355748bf293bea
parent 13034 7693573f862d
child 13036 f5e7a1b95ffd
RPI_FreeCursor: set global_cursor to NULL to prevent double-free (bug 4769)
src/video/raspberry/SDL_rpimouse.c
     1.1 --- a/src/video/raspberry/SDL_rpimouse.c	Sat Aug 24 20:40:37 2019 +0200
     1.2 +++ b/src/video/raspberry/SDL_rpimouse.c	Mon Aug 26 18:41:40 2019 +0300
     1.3 @@ -226,6 +226,9 @@
     1.4              SDL_free(cursor->driverdata);
     1.5          }
     1.6          SDL_free(cursor);
     1.7 +        if (cursor == global_cursor) {
     1.8 +            global_cursor = NULL;
     1.9 +        }
    1.10      }
    1.11  }
    1.12