Skip to content

Commit

Permalink
Fix: memory leak from magic fountain effect.
Browse files Browse the repository at this point in the history
  • Loading branch information
elunna committed Dec 19, 2024
1 parent 419b2ed commit a85066b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/fountain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a85066b

Please sign in to comment.