fix double free
This commit is contained in:
parent
72b3c624d1
commit
c9f3681460
1 changed files with 6 additions and 1 deletions
|
|
@ -253,7 +253,12 @@ pub const Cache = struct {
|
|||
}
|
||||
|
||||
pub fn get(self: *Cache, ip: u128) ?Location {
|
||||
return self.entries.get(ip);
|
||||
const entry = self.entries.get(ip) orelse return null;
|
||||
return .{
|
||||
.allocator = self.allocator,
|
||||
.name = self.allocator.dupe(u8, entry.name) catch return null,
|
||||
.coords = entry.coords,
|
||||
};
|
||||
}
|
||||
|
||||
pub fn put(self: *Cache, ip: u128, family: u8, loc: Location) !void {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue