diff --git a/src/gossip/cmd.zig b/src/gossip/cmd.zig index 0282d9b20..f3f9b6fe7 100644 --- a/src/gossip/cmd.zig +++ b/src/gossip/cmd.zig @@ -16,7 +16,8 @@ const IDENTITY_KEYPAIR_DIR = "/.sig"; const IDENTITY_KEYPAIR_PATH = "/identity.key"; pub fn getOrInitIdentity(allocator: std.mem.Allocator, logger: *Logger) !Keypair { - const home_dir = std.os.getenv("HOME") orelse return error.UnableDetectHomeDir; + const home_dir = try std.process.getEnvVarOwned(allocator, "HOME"); + defer allocator.free(home_dir); var path = try std.mem.concat(allocator, u8, &[_][]const u8{ home_dir, IDENTITY_KEYPAIR_DIR, IDENTITY_KEYPAIR_PATH }); if (std.fs.openFileAbsolute(path, .{})) |file| {