mirror of
https://github.com/ziglang/zig.git
synced 2026-01-06 05:25:10 +00:00
std.http.Client: fix alignment when freeing memory
This commit is contained in:
parent
847afd0a47
commit
d9aa84de28
@ -283,7 +283,7 @@ pub const Connection = struct {
|
||||
fn destroy(plain: *Plain) void {
|
||||
const c = &plain.connection;
|
||||
const gpa = c.client.allocator;
|
||||
const base: [*]u8 = @ptrCast(plain);
|
||||
const base: [*]align(@alignOf(Plain)) u8 = @ptrCast(plain);
|
||||
gpa.free(base[0..allocLen(c.client, c.host_len)]);
|
||||
}
|
||||
|
||||
@ -356,7 +356,7 @@ pub const Connection = struct {
|
||||
fn destroy(tls: *Tls) void {
|
||||
const c = &tls.connection;
|
||||
const gpa = c.client.allocator;
|
||||
const base: [*]u8 = @ptrCast(tls);
|
||||
const base: [*]align(@alignOf(Tls)) u8 = @ptrCast(tls);
|
||||
gpa.free(base[0..allocLen(c.client, c.host_len)]);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user