From 1639676e8da2db5c20cfc0f9465739600e40384a Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Fri, 3 Sep 2021 09:14:04 -0500 Subject: [PATCH] Actually free the drawnstr pointer after we're done using it. It probably was like this originally because past Golden was confused about why free was throwing errors :P --- src/m_menu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/m_menu.c b/src/m_menu.c index 6db0f4c78..ac5269c3e 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -11619,6 +11619,7 @@ static void M_DrawMPMainMenu(void) const INT32 boxwidth = /*16*8 + 6*/ (BASEVIDWIDTH - 2*(x+5)); const INT32 maxstrwidth = boxwidth - 5; char *drawnstr = malloc(sizeof(setupm_ip)); + char *drawnstr_orig = drawnstr; boolean drawthin, shorten = false; // use generic drawer for cursor, items and title @@ -11678,6 +11679,8 @@ static void M_DrawMPMainMenu(void) else V_DrawCharacter(x+8+V_StringWidth(drawnstr, V_ALLOWLOWERCASE),y+12,'_',false); } + + free(drawnstr_orig); } #undef DOTS