]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - parse.c
Fix memory leaks, more memory tracker stuff as well.
[xonotic/gmqcc.git] / parse.c
diff --git a/parse.c b/parse.c
index 6423f5daa4b7d14979702843f5541e86e372ee15..8e7f0a65298730ded7e0bafa3848eb4f84c8b6e0 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -291,5 +291,14 @@ int parse_gen(struct lex_file *file) {
     }
     compile_constant_debug();
     lex_reset(file);
+    /* free constants */
+    {
+               size_t i;
+               for (; i < compile_constants_elements; i++) {
+                       mem_d(compile_constants_data[i].name);
+                       mem_d(compile_constants_data[i].string);
+               }
+               mem_d(compile_constants_data);
+       }
     return 1;
 }