diff --git a/src/bun.js/api/js_zlib.zig b/src/bun.js/api/js_zlib.zig index ab134c6369..dcc477ee25 100644 --- a/src/bun.js/api/js_zlib.zig +++ b/src/bun.js/api/js_zlib.zig @@ -128,9 +128,10 @@ pub const ZlibEncoder = struct { this.stream.flush = @enumFromInt(int); } - const input_to_queue = JSC.Node.BlobOrStringOrBuffer.fromJSWithEncodingValueMaybeAsync(globalThis, bun.default_allocator, input, optional_encoding, true) orelse { + const input_to_queue = JSC.Node.BlobOrStringOrBuffer.fromJSWithEncodingValueMaybeAsync(globalThis, bun.default_allocator, input, optional_encoding, false) orelse { return globalThis.throwInvalidArgumentTypeValue("buffer", "string or an instance of Buffer, TypedArray, DataView, or ArrayBuffer", input); }; + defer input_to_queue.deinit(); if (is_last) this.has_called_end = true; @@ -184,9 +185,10 @@ pub const ZlibEncoder = struct { }; if (globalThis.hasException()) return .zero; - const input_to_queue = JSC.Node.BlobOrStringOrBuffer.fromJSWithEncodingValueMaybeAsync(globalThis, bun.default_allocator, input, optional_encoding, true) orelse { + const input_to_queue = JSC.Node.BlobOrStringOrBuffer.fromJSWithEncodingValueMaybeAsync(globalThis, bun.default_allocator, input, optional_encoding, false) orelse { return globalThis.throwInvalidArgumentTypeValue("buffer", "string or an instance of Buffer, TypedArray, DataView, or ArrayBuffer", input); }; + defer input_to_queue.deinit(); if (is_last) this.has_called_end = true; @@ -611,10 +613,10 @@ pub const ZlibDecoder = struct { }; if (globalThis.hasException()) return .zero; - const input_to_queue = JSC.Node.BlobOrStringOrBuffer.fromJSWithEncodingValueMaybeAsync(globalThis, bun.default_allocator, input, optional_encoding, true) orelse { + const input_to_queue = JSC.Node.BlobOrStringOrBuffer.fromJSWithEncodingValue(globalThis, bun.default_allocator, input, optional_encoding) orelse { return globalThis.throwInvalidArgumentTypeValue("buffer", "string or an instance of Buffer, TypedArray, DataView, or ArrayBuffer", input); }; - + defer input_to_queue.deinit(); if (is_last) this.has_called_end = true;