From ab78147991450ba581a305e741a8d51987f8f953 Mon Sep 17 00:00:00 2001 From: cuz Date: Mon, 10 May 2004 21:06:53 +0000 Subject: [PATCH] Fixed a small memory leak git-svn-id: svn://svn.cc65.org/cc65/trunk@3018 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ca65/macro.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ca65/macro.c b/src/ca65/macro.c index 06d619582..70bd91e48 100644 --- a/src/ca65/macro.c +++ b/src/ca65/macro.c @@ -284,9 +284,15 @@ static void FreeMacExp (MacExp* E) /* One macro expansion less */ --MacExpansions; - /* Free the parameter list */ + /* Free the parameter lists */ for (I = 0; I < E->ParamCount; ++I) { - xfree (E->Params [I]); + /* Free one parameter list */ + TokNode* N = E->Params[I]; + while (N) { + TokNode* P = N->Next; + FreeTokNode (N); + N = P; + } } xfree (E->Params); -- 2.39.5