diff options
| author | 2024-06-20 20:42:50 +0000 | |
|---|---|---|
| committer | 2024-06-20 20:42:50 +0000 | |
| commit | 3dd03323aa8825a0c7bf4dcc1ed6d6c3b88a3d7f (patch) | |
| tree | e05639565a22611c334a83a35a998f3fba3e1f1a /libs/binder/Parcel.cpp | |
| parent | 447d0a33acc9827809d1049023b05e4cac05fc70 (diff) | |
| parent | bb1814a0b94e8efb3fa3843c3d6a6533a382cac3 (diff) | |
Merge "Merge 24Q3 (ab/11976889) to aosp-main-future" into aosp-main-future
Diffstat (limited to 'libs/binder/Parcel.cpp')
| -rw-r--r-- | libs/binder/Parcel.cpp | 5 |
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) { |