commit 1cfcab4c63a1cf8817261ca5564f65ccb661180f
parent 17d9c2036f8edebcf3c066778e08083ee6ddd78f
Author: Sebastian <sebastian@sebsite.pw>
Date: Fri, 13 May 2022 22:45:35 -0400
cmd/hare: free defines and libs slices
Signed-off-by: Sebastian <sebastian@sebsite.pw>
Diffstat:
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/cmd/hare/plan.ha b/cmd/hare/plan.ha
@@ -136,7 +136,6 @@ fn plan_finish(plan: *plan) void = {
free(plan.environ);
free(plan.script);
- free(plan.libs);
for (let i = 0z; i < len(plan.modmap); i += 1) {
free(plan.modmap[i]);
diff --git a/cmd/hare/subcmds.ha b/cmd/hare/subcmds.ha
@@ -93,7 +93,9 @@ fn build(args: []str) void = {
let output = "";
let goal = goal::EXE;
let defines: []str = [];
+ defer free(defines);
let libs: []str = [];
+ defer free(libs);
for (let i = 0z; i < len(cmd.opts); i += 1) {
let opt = cmd.opts[i];
switch (opt.0) {
@@ -288,7 +290,9 @@ fn run(args: []str) void = {
let verbose = false;
let defines: []str = [];
+ defer free(defines);
let libs: []str = [];
+ defer free(libs);
for (let i = 0z; i < len(cmd.opts); i += 1) {
let opt = cmd.opts[i];
switch (opt.0) {
@@ -401,7 +405,9 @@ fn test(args: []str) void = {
let output = "";
let verbose = false;
let defines: []str = [];
+ defer free(defines);
let libs: []str = [];
+ defer free(libs);
for (let i = 0z; i < len(cmd.opts); i += 1) {
const opt = cmd.opts[i];
switch (opt.0) {