From 1a293cd42e0f3ca7034e4cf67392eb09fc7861f3 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sun, 23 Jun 2024 11:14:57 -0400 Subject: [PATCH] Fix window memory allocation bug. --- src/renderer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer.c b/src/renderer.c index eefb1fa0..c36f7d02 100644 --- a/src/renderer.c +++ b/src/renderer.c @@ -519,7 +519,7 @@ void ren_draw_rect(RenSurface *rs, RenRect rect, RenColor color) { /*************** Window Management ****************/ static void ren_add_window(RenWindow *window_renderer) { window_count += 1; - window_list = realloc(window_list, window_count); + window_list = realloc(window_list, window_count * sizeof(RenWindow*)); window_list[window_count-1] = window_renderer; }