From a85066b29f38882daa6aa084db8255b1c6ade63f Mon Sep 17 00:00:00 2001 From: Erik Lunna Date: Thu, 19 Dec 2024 16:40:35 +0100 Subject: [PATCH] Fix: memory leak from magic fountain effect. --- src/fountain.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fountain.c b/src/fountain.c index 34fa0a24c0..d4576f015d 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -749,13 +749,15 @@ drinkfountain(void) pseudo->cursed = 0; pseudo->blessed = 1; peffects(pseudo); - + obfree(pseudo, (struct obj *) 0); + /* gain ability, blessed if "natural" luck is high */ pseudo = mksobj(POT_GAIN_ABILITY, FALSE, FALSE); pseudo->cursed = 0; pseudo->blessed = !littleluck; peffects(pseudo); - + obfree(pseudo, (struct obj *) 0); + display_nhwindow(WIN_MESSAGE, FALSE); pline("A wisp of vapor escapes the fountain..."); exercise(A_WIS, TRUE);