hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 1710c0b9accddf51c9634c6bfffa48d503064f31
parent dd05c7c2a081b0621e22983c9e2927d1bb559072
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sat,  9 Dec 2023 21:14:07 -0500

cmd/*: fix memory leaks

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mcmd/hare/util.ha | 1+
Mcmd/haredoc/util.ha | 1+
2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/cmd/hare/util.ha b/cmd/hare/util.ha @@ -15,6 +15,7 @@ fn merge_tags(current: *[]str, new: str) (void | module::error) = { *current = []; }; let newtags = module::parse_tags(trimmed)?; + defer free(newtags); for :new (let i = 0z; i < len(newtags); i += 1) { for (let j = 0z; j < len(current); j += 1) { if (newtags[i].name == current[j]) { diff --git a/cmd/haredoc/util.ha b/cmd/haredoc/util.ha @@ -17,6 +17,7 @@ fn merge_tags(current: *[]str, new: str) (void | module::error) = { *current = []; }; let newtags = module::parse_tags(trimmed)?; + defer free(newtags); for :new (let i = 0z; i < len(newtags); i += 1) { for (let j = 0z; j < len(current); j += 1) { if (newtags[i].name == current[j]) {