diff options
author | 2022-11-25 03:02:56 -0800 | |
---|---|---|
committer | 2022-11-25 03:02:56 -0800 | |
commit | 9090f06612cbff5bd389212a8d896bcd6372683f (patch) | |
tree | 24fd6dd34786735913d7a95d1922e6afd6ab20db /src | |
parent | 7a193ed243732f2bb606dc8f0c87d77058f9fff3 (diff) | |
download | bun-9090f06612cbff5bd389212a8d896bcd6372683f.tar.gz bun-9090f06612cbff5bd389212a8d896bcd6372683f.tar.zst bun-9090f06612cbff5bd389212a8d896bcd6372683f.zip |
Fix memory leak with `.json()`
Diffstat (limited to 'src')
-rw-r--r-- | src/bun.js/webcore/response.zig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bun.js/webcore/response.zig b/src/bun.js/webcore/response.zig index 121078210..03bf94c68 100644 --- a/src/bun.js/webcore/response.zig +++ b/src/bun.js/webcore/response.zig @@ -3660,6 +3660,7 @@ pub const Blob = struct { // null == unknown // false == can't be const could_be_all_ascii = this.is_all_ascii orelse this.store.?.is_all_ascii; + defer if (comptime lifetime == .temporary) bun.default_allocator.free(bun.constStrToU8(buf)); if (could_be_all_ascii == null or !could_be_all_ascii.?) { // if toUTF16Alloc returns null, it means there are no non-ASCII characters |