diff options
| author | 2019-10-17 19:53:09 +0000 | |
|---|---|---|
| committer | 2019-10-17 19:53:09 +0000 | |
| commit | 2ed97dbd72caeb56fbc7bc9af64572f464decdc7 (patch) | |
| tree | 435372d81ef49f13ca5f230797ad407adb233e44 | |
| parent | 0d8aaa2eedbd0c0e2fc6379fa319598f6b229efd (diff) | |
| parent | c67d9f33b36cbb95b121d058f51d6653f1ec4334 (diff) | |
Merge "Resize object capacity when shrinking Parcel"
| -rw-r--r-- | libs/binder/Parcel.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index b70e57d49c..323e079514 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -2562,11 +2562,13 @@ status_t Parcel::continueWrite(size_t desired) if (objectsSize == 0) { free(mObjects); mObjects = nullptr; + mObjectsCapacity = 0; } else { binder_size_t* objects = (binder_size_t*)realloc(mObjects, objectsSize*sizeof(binder_size_t)); if (objects) { mObjects = objects; + mObjectsCapacity = objectsSize; } } mObjectsSize = objectsSize; |