Commit 9fcc630fb33acbe0024ad36da7a27e33b10277cb

Sylvain 2021-11-22T16:37:34

X11: use SDL_malloc

diff --git a/src/video/x11/SDL_x11shape.c b/src/video/x11/SDL_x11shape.c
index 372db60..112aee4 100644
--- a/src/video/x11/SDL_x11shape.c
+++ b/src/video/x11/SDL_x11shape.c
@@ -35,7 +35,7 @@ X11_CreateShaper(SDL_Window* window) {
 
 #if SDL_VIDEO_DRIVER_X11_XSHAPE
     if (SDL_X11_HAVE_XSHAPE) {  /* Make sure X server supports it. */
-        result = malloc(sizeof(SDL_WindowShaper));
+        result = SDL_malloc(sizeof(SDL_WindowShaper));
         result->window = window;
         result->mode.mode = ShapeModeDefault;
         result->mode.parameters.binarizationCutoff = 1;
@@ -65,8 +65,8 @@ X11_ResizeWindowShape(SDL_Window* window) {
     if(data->bitmapsize != bitmapsize || data->bitmap == NULL) {
         data->bitmapsize = bitmapsize;
         if(data->bitmap != NULL)
-            free(data->bitmap);
-        data->bitmap = malloc(data->bitmapsize);
+            SDL_free(data->bitmap);
+        data->bitmap = SDL_malloc(data->bitmapsize);
         if(data->bitmap == NULL) {
             return SDL_SetError("Could not allocate memory for shaped-window bitmap.");
         }