From: cuz Date: Mon, 10 May 2004 21:06:53 +0000 (+0000) Subject: Fixed a small memory leak X-Git-Tag: V2.12.0~812 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ab78147991450ba581a305e741a8d51987f8f953;p=cc65 Fixed a small memory leak git-svn-id: svn://svn.cc65.org/cc65/trunk@3018 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- 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);