bytecode_parse: Fix memory leaks in test
authorSebastian Dröge <sebastian@centricular.com>
Sun, 13 Apr 2014 19:22:28 +0000 (21:22 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Sun, 13 Apr 2014 19:22:28 +0000 (21:22 +0200)
testsuite/bytecode_parse.c

index fb1e587..966e3e8 100644 (file)
@@ -43,6 +43,7 @@ main (int argc, char *argv[])
   }
 
   n = orc_parse (code, &programs);
+  free (code);
 
   for(i=0;i<n;i++){
     OrcBytecode *bytecode;
@@ -54,7 +55,10 @@ main (int argc, char *argv[])
       printf("%d, ", bytecode->bytecode[j]);
     }
     printf("\n");
+    orc_bytecode_free (bytecode);
+    orc_program_free (programs[i]);
   }
+  free (programs);
 
   if (error) return 1;
   return 0;