!1402 fix:Fix memory leak issues

Merge pull request !1402 from crazy_hu/master
This commit is contained in:
openharmony_ci 2024-09-27 09:59:52 +00:00 committed by Gitee
commit 7de75ad805
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -926,6 +926,7 @@ int BinderInvoker::HandleReply(MessageParcel *reply, bool &isStubRet)
auto allocator = new (std::nothrow) BinderAllocator();
if (allocator == nullptr) {
ZLOGE(LABEL, "create BinderAllocator object failed");
FreeBuffer(reinterpret_cast<void *>(tr->data.ptr.buffer));
return IPC_INVOKER_INVALID_DATA_ERR;
}
if (!reply->SetAllocator(allocator)) {