Skip to content

Commit

Permalink
dont leak the address string in UDPSocket.addressToString (#14127)
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro authored Sep 26, 2024
1 parent af12ff1 commit ec7078a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bun.js/api/bun/udp_socket.zig
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,8 @@ pub const UDPSocket = struct {
};

const slice = bun.fmt.formatIp(address, &text_buf) catch unreachable;
return bun.String.createLatin1(slice).toJS(globalThis);
var str = bun.String.createLatin1(slice);
return str.transferToJS(globalThis);
}

pub fn getAddress(this: *This, globalThis: *JSGlobalObject) JSValue {
Expand Down

0 comments on commit ec7078a

Please sign in to comment.