aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/api')
-rw-r--r--src/bun.js/api/JSBundler.zig6
-rw-r--r--src/bun.js/api/bun/socket.zig6
-rw-r--r--src/bun.js/api/server.zig2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/bun.js/api/JSBundler.zig b/src/bun.js/api/JSBundler.zig
index af1a55ce6..f5c3793ed 100644
--- a/src/bun.js/api/JSBundler.zig
+++ b/src/bun.js/api/JSBundler.zig
@@ -594,8 +594,8 @@ pub const JSBundler = struct {
external: bool = false,
pub fn deinit(this: *@This()) void {
- bun.default_allocator.destroy(this.path);
- bun.default_allocator.destroy(this.namespace);
+ bun.default_allocator.free(this.path);
+ bun.default_allocator.free(this.namespace);
}
},
no_match: void,
@@ -747,7 +747,7 @@ pub const JSBundler = struct {
pub fn deinit(this: *Value) void {
switch (this.*) {
.success => |success| {
- bun.default_allocator.destroy(success.source_code);
+ bun.default_allocator.free(success.source_code);
},
.err => |*err| {
err.deinit(bun.default_allocator);
diff --git a/src/bun.js/api/bun/socket.zig b/src/bun.js/api/bun/socket.zig
index 5da6c1f40..592fd6540 100644
--- a/src/bun.js/api/bun/socket.zig
+++ b/src/bun.js/api/bun/socket.zig
@@ -499,10 +499,10 @@ pub const Listener = struct {
pub fn deinit(this: UnixOrHost) void {
switch (this) {
.unix => |u| {
- bun.default_allocator.destroy(@as([*]u8, @ptrFromInt(@intFromPtr(u.ptr))));
+ bun.default_allocator.free(u);
},
.host => |h| {
- bun.default_allocator.destroy(@as([*]u8, @ptrFromInt(@intFromPtr(h.host.ptr))));
+ bun.default_allocator.free(h.host);
},
}
}
@@ -833,7 +833,7 @@ pub const Listener = struct {
this.connection.deinit();
if (this.protos) |protos| {
this.protos = null;
- bun.default_allocator.destroy(protos);
+ bun.default_allocator.free(protos);
}
bun.default_allocator.destroy(this);
}
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig
index e96135a5e..64a85d6a4 100644
--- a/src/bun.js/api/server.zig
+++ b/src/bun.js/api/server.zig
@@ -5131,7 +5131,7 @@ pub fn NewServer(comptime NamespaceType: type, comptime ssl_enabled_: bool, comp
this.cached_protocol.deref();
if (this.config.hostname) |host| {
- bun.default_allocator.destroy(host);
+ bun.default_allocator.free(host[0 .. std.mem.len(host) + 1]);
}
if (this.config.base_url.href.len > 0) {