]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - assembler.c
Fix memory leaks, more memory tracker stuff as well.
[xonotic/gmqcc.git] / assembler.c
index 9111e2b9d1c8b263034b1631509919f74981c4fd..29375ac0e483db2f3b88ac68b5b199efb2a1068c 100644 (file)
@@ -154,6 +154,13 @@ typedef struct {
     int   offset; /* location in globals */
 } globals;
 VECTOR_MAKE(globals, assembly_constants);
+
+void asm_clear() {
+       size_t i = 0;
+       for (; i < assembly_constants_elements; i++)
+               mem_d(assembly_constants_data[i].name);
+       mem_d(assembly_constants_data);
+}
     
 void asm_parse(FILE *fp) {
     char     *data  = NULL;
@@ -321,8 +328,8 @@ void asm_parse(FILE *fp) {
             printf("%li: Invalid statement, expression, or decleration\n", line);
         
         end:
-        //free(data);
         mem_d(data);
         line ++;
     }
+    asm_clear();
 }