hare

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

commit 8683c18641b931e2ddaf574858f4edadfd40c1e6
parent b418d70857bd7262362b1a48f72f47f79622c03e
Author: Sebastian <sebastian@sebsite.pw>
Date:   Thu, 31 Aug 2023 02:11:39 -0400

os::exec: remove free

There's no guarantee that cmd.argv[0] is heap-allocated, and if it is,
it's owned by the caller anyways.

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

Diffstat:
Mos/exec/cmd.ha | 1-
1 file changed, 0 insertions(+), 1 deletion(-)

diff --git a/os/exec/cmd.ha b/os/exec/cmd.ha @@ -56,7 +56,6 @@ export fn cmdfile(file: io::file, name: str, args: str...) command = { // Sets the 0th value of argv for this command. It is uncommon to need this. export fn setname(cmd: *command, name: str) void = { - free(cmd.argv[0]); cmd.argv[0] = name; };