From 11b20aa508a31e264e545236dfdc84279eb32483 Mon Sep 17 00:00:00 2001 From: Meghan Denny Date: Tue, 18 Nov 2025 12:00:56 -0800 Subject: [PATCH] runtime: fix small leak in Bun.listen (#24799) pulled out of https://github.com/oven-sh/bun/pull/21663 Co-authored-by: Ciro Spaciari --- src/bun.js/api/bun/socket/Listener.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bun.js/api/bun/socket/Listener.zig b/src/bun.js/api/bun/socket/Listener.zig index 420347cb38..be9e10b62f 100644 --- a/src/bun.js/api/bun/socket/Listener.zig +++ b/src/bun.js/api/bun/socket/Listener.zig @@ -234,6 +234,7 @@ pub fn listen(globalObject: *jsc.JSGlobalObject, opts: JSValue) bun.JSError!JSVa } const hostname = bun.handleOom(hostname_or_unix.intoOwnedSlice(bun.default_allocator)); + errdefer bun.default_allocator.free(hostname); var connection: Listener.UnixOrHost = if (port) |port_| .{ .host = .{ .host = hostname,