From 1e47790c8d2aac850aacc751f169f4ef0456521e Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Mon, 26 Aug 2019 18:41:40 +0300 Subject: [PATCH] RPI_FreeCursor: set global_cursor to NULL to prevent double-free (bug 4769) --- src/video/raspberry/SDL_rpimouse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/video/raspberry/SDL_rpimouse.c b/src/video/raspberry/SDL_rpimouse.c index 0a51a40e6..134ebf6b7 100644 --- a/src/video/raspberry/SDL_rpimouse.c +++ b/src/video/raspberry/SDL_rpimouse.c @@ -226,6 +226,9 @@ RPI_FreeCursor(SDL_Cursor * cursor) SDL_free(cursor->driverdata); } SDL_free(cursor); + if (cursor == global_cursor) { + global_cursor = NULL; + } } }