From 38060978e2d3b103770012d8d65d5b611720e47e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 28 Feb 2023 11:07:03 -0800 Subject: [PATCH] termio/exec: don't pass pointer to stack var --- src/termio/Exec.zig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/termio/Exec.zig b/src/termio/Exec.zig index b55167dd6..d8d4d9cee 100644 --- a/src/termio/Exec.zig +++ b/src/termio/Exec.zig @@ -403,9 +403,10 @@ const Subprocess = struct { // If we're NOT in a flatpak (usually!), then we just exec the // process directly. If we are in a flatpak, we use flatpak-spawn // to escape the sandbox. - const args = if (!internal_os.isFlatpak()) &[_][]const u8{ - argv0_override orelse path, - } else args: { + const args = if (!internal_os.isFlatpak()) try alloc.dupe( + []const u8, + &[_][]const u8{argv0_override orelse path}, + ) else args: { var args = try std.ArrayList([]const u8).initCapacity(alloc, 8); defer args.deinit();