From 2df5db1f04e462b4ecb40e18cc9258a13e312de3 Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 29 Sep 2002 21:15:02 +0000 Subject: [PATCH] Call StrBuf destructors git-svn-id: svn://svn.cc65.org/cc65/trunk@1415 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/pragma.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/cc65/pragma.c b/src/cc65/pragma.c index 21203944f..b26ef7bc8 100644 --- a/src/cc65/pragma.c +++ b/src/cc65/pragma.c @@ -136,12 +136,16 @@ static void StringPragma (StrBuf* B, void (*Func) (const char*)) { StrBuf S; + /* We expect a string here */ if (SB_GetString (B, &S)) { /* Call the given function with the string argument */ Func (SB_GetConstBuf (&S)); } else { Error ("String literal expected"); } + + /* Call the string buf destructor */ + DoneStrBuf (&S); } @@ -171,7 +175,10 @@ static void SegNamePragma (StrBuf* B, segment_t Seg) } else { Error ("String literal expected"); - } + } + + /* Call the string buf destructor */ + DoneStrBuf (&S); } @@ -345,6 +352,9 @@ static void ParsePragma (void) if (SB_Peek (&B) != '\0') { Error ("Unexpected input following pragma directive"); } + + /* Release the StrBuf */ + DoneStrBuf (&B); }