summaryrefslogtreecommitdiff
path: root/libs/binder/Parcel.cpp
diff options
context:
space:
mode:
author Xin Li <delphij@google.com> 2024-06-18 14:13:37 -0700
committer Xin Li <delphij@google.com> 2024-06-18 14:13:37 -0700
commitbb1814a0b94e8efb3fa3843c3d6a6533a382cac3 (patch)
tree27e66123b9acee1a608b520afebbce3b6cd3c037 /libs/binder/Parcel.cpp
parent13fde70bd413e24c6667ec8ad84ea0d9e07058d6 (diff)
parent29f1274c966a27f929cf8d6f21a538d53a3f9ac3 (diff)
Merge 24Q3 (ab/11976889) to aosp-main-future
Bug: 347831320 Merged-In: I30f4c21dfee68603d0dad01d205f8a5581e6db31 Change-Id: I301c522ae67cc1f30fe0ddc819aa3dffd4c32d1a
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r--libs/binder/Parcel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp
index 77b32753de..3f70e8c104 100644
--- a/libs/binder/Parcel.cpp
+++ b/libs/binder/Parcel.cpp
@@ -2977,14 +2977,15 @@ status_t Parcel::restartWrite(size_t desired)
return continueWrite(desired);
}
+ releaseObjects();
+
uint8_t* data = reallocZeroFree(mData, mDataCapacity, desired, mDeallocZero);
if (!data && desired > mDataCapacity) {
+ LOG_ALWAYS_FATAL("out of memory");
mError = NO_MEMORY;
return NO_MEMORY;
}
- releaseObjects();
-
if (data || desired == 0) {
LOG_ALLOC("Parcel %p: restart from %zu to %zu capacity", this, mDataCapacity, desired);
if (mDataCapacity > desired) {