From 22f9467e71688376dafb2b373c8f324e69e489b4 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 4 Mar 2023 17:33:56 +0000 Subject: [PATCH] M_ClearConditionSet: fix memory leak --- src/m_cond.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/m_cond.c b/src/m_cond.c index f043d8454..f41f348c6 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -511,9 +511,14 @@ void M_ClearConditionSet(UINT8 set) { if (conditionSets[set].numconditions) { + while (conditionSets[set].numconditions > 0) + { + --conditionSets[set].numconditions; + Z_Free(conditionSets[set].condition[conditionSets[set].numconditions].pendingstring); + } + Z_Free(conditionSets[set].condition); conditionSets[set].condition = NULL; - conditionSets[set].numconditions = 0; } gamedata->achieved[set] = false; }