Commit 1db47d468acde73d38a4e96f47e16a7edf0ce55f

Mathieu Eyraud 2022-03-28T15:39:13

Fix potential memory leak in QueueCmdFillRects

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index 30fee88..554f8a4 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -580,10 +580,10 @@ QueueCmdFillRects(SDL_Renderer *renderer, const SDL_FRect * rects, const int cou
                 if (retval < 0) {
                     cmd->command = SDL_RENDERCMD_NO_OP;
                 }
-
-                SDL_small_free(xy, isstack1);
-                SDL_small_free(indices, isstack2);
             }
+            SDL_small_free(xy, isstack1);
+            SDL_small_free(indices, isstack2);
+            
         } else {
             retval = renderer->QueueFillRects(renderer, cmd, rects, count);
             if (retval < 0) {