zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 819c868bbf362ac869ff65a9632969f3bc1a749a (tree)
parent 889efddd1a2b12d3348f06900436b9ba8c823a01
Author: Veikka Touminen <git@vexu.eu>
Date:   Sun, 10 Jul 2022 04:27:23 -0600

std.net.getAddressList: fix segfault on bad hostname

Fixes #12065

Diffstat:
Mlib/std/net.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/net.zig b/lib/std/net.zig @@ -731,7 +731,7 @@ pub fn getAddressList(allocator: mem.Allocator, name: []const u8, port: u16) !*A break :blk result; }; const arena = result.arena.allocator(); - errdefer result.arena.deinit(); + errdefer result.deinit(); if (builtin.target.os.tag == .windows or builtin.link_libc) { const name_c = try std.cstr.addNullByte(allocator, name);