Commit 819c868bbf

Veikka Touminen <git@vexu.eu>
2022-07-10 12:27:23
std.net.getAddressList: fix segfault on bad hostname
Fixes #12065
1 parent 889efdd
Changed files (1)
lib
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);