runtime: fix small leak in Bun.listen (#24799)

pulled out of https://github.com/oven-sh/bun/pull/21663

Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
This commit is contained in:
Meghan Denny
2025-11-18 12:00:56 -08:00
committed by GitHub
parent cac8e62635
commit 11b20aa508

View File

@@ -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,