termio/exec: don't pass pointer to stack var

This commit is contained in:
Mitchell Hashimoto
2023-02-28 11:07:03 -08:00
parent d49c65d101
commit 38060978e2

View File

@ -403,9 +403,10 @@ const Subprocess = struct {
// If we're NOT in a flatpak (usually!), then we just exec the // 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 // process directly. If we are in a flatpak, we use flatpak-spawn
// to escape the sandbox. // to escape the sandbox.
const args = if (!internal_os.isFlatpak()) &[_][]const u8{ const args = if (!internal_os.isFlatpak()) try alloc.dupe(
argv0_override orelse path, []const u8,
} else args: { &[_][]const u8{argv0_override orelse path},
) else args: {
var args = try std.ArrayList([]const u8).initCapacity(alloc, 8); var args = try std.ArrayList([]const u8).initCapacity(alloc, 8);
defer args.deinit(); defer args.deinit();