Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak due to JSStringRelease not called in multiple places in JSCRuntime.cpp #25884

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions ReactCommon/jsi/JSCRuntime.cpp
Expand Up @@ -630,7 +630,9 @@ jsi::String JSCRuntime::createStringFromUtf8(
size_t length) {
std::string tmp(reinterpret_cast<const char*>(str), length);
JSStringRef stringRef = JSStringCreateWithUTF8CString(tmp.c_str());
return createString(stringRef);
auto result = createString(stringRef);
JSStringRelease(stringRef);
return result;
}

std::string JSCRuntime::utf8(const jsi::String& str) {
Expand Down Expand Up @@ -1411,4 +1413,4 @@ std::unique_ptr<jsi::Runtime> makeJSCRuntime() {
}

} // namespace jsc
} // namespace facebook
} // namespace facebook