Fix "Optimize cstr_reset() to only reset string to empty"
authorgrischka <grischka>
Sun, 6 Jan 2013 16:21:33 +0000 (6 17:21 +0100)
committergrischka <grischka>
Sun, 6 Jan 2013 16:21:33 +0000 (6 17:21 +0100)
This fixes commit 8eb92e605200b1fe8d570ad309e28245c3f1af0a

Remove memory leak.

tccpp.c

diff --git a/tccpp.c b/tccpp.c
index 05098e1..c0c7aec 100644 (file)
--- a/tccpp.c
+++ b/tccpp.c
@@ -2857,7 +2857,7 @@ static inline int *macro_twosharps(const int *macro_str)
                         n, cstr.data, (char*)cstr.data + n);
                 }
                 tcc_close();
-                cstr_reset(&cstr);
+                cstr_free(&cstr);
             }
         }
         if (tok != TOK_NOSUBST)