fix:Fix memory leak issues

Signed-off-by: hu-xiusong <huxiusong1@huawei.com>
This commit is contained in:
hu-xiusong 2024-09-26 02:58:36 +00:00
parent d16042fcd2
commit ece9623700

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)) {