diff options
author | 2023-07-30 02:03:32 -0700 | |
---|---|---|
committer | 2023-07-30 02:03:32 -0700 | |
commit | 1db119ec1180fbbfb5fa55d46f3b38ea19738bc2 (patch) | |
tree | 64eb6f456d47c287856bfdf7bf2d50c1ea2237b7 /src/bun.js/bindings/ZigGlobalObject.cpp | |
parent | 413fd281208f24a532c47249dec1bfc3aef2bf37 (diff) | |
download | bun-1db119ec1180fbbfb5fa55d46f3b38ea19738bc2.tar.gz bun-1db119ec1180fbbfb5fa55d46f3b38ea19738bc2.tar.zst bun-1db119ec1180fbbfb5fa55d46f3b38ea19738bc2.zip |
Fix memory leak (#3887)
* Fix memory leak
* Remove an extra copy
* Further fixes
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js/bindings/ZigGlobalObject.cpp')
-rw-r--r-- | src/bun.js/bindings/ZigGlobalObject.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index ffd6e990a..3776adb2b 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -227,11 +227,11 @@ public: if (encodedString.isNull()) return String(); - auto decodedData = base64Decode(encodedString, Base64DecodeMode::DefaultValidatePaddingAndIgnoreWhitespace); + auto decodedData = base64DecodeToString(encodedString, Base64DecodeMode::DefaultValidatePaddingAndIgnoreWhitespace); if (!decodedData) return Exception { InvalidCharacterError }; - return String(decodedData->data(), decodedData->size()); + return decodedData; } }; |