Skip to content

Commit 04ae7dc

Browse files
committed
Fix dangling pointer in ipToBytes
1 parent d1be2b7 commit 04ae7dc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/net.zig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ pub const IP = union(enum) {
7878
pub fn ipToBytes(address: *const std.net.Address) []const u8 {
7979
return switch (address.any.family) {
8080
std.posix.AF.INET => {
81-
const b = std.mem.asBytes(&address.in.sa.addr).*;
82-
return &b;
81+
return std.mem.asBytes(&address.in.sa.addr);
8382
},
8483
std.posix.AF.INET6 => &address.in6.sa.addr,
8584
else => unreachable,

0 commit comments

Comments
 (0)