Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0ed7b29 authored by Michael Wachenschwanz's avatar Michael Wachenschwanz Committed by android-build-merger
Browse files

Merge "Free mObjects if no objects left to realloc on resize" into qt-dev

am: 4f65d337

Change-Id: I9823f61daf12de6122dfb312890f42c6a2e2a8bb
parents 0ea5b103 4f65d337
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -2835,11 +2835,17 @@ status_t Parcel::continueWrite(size_t desired)
                }
                release_object(proc, *flat, this, &mOpenAshmemSize);
            }

            if (objectsSize == 0) {
                free(mObjects);
                mObjects = nullptr;
            } else {
                binder_size_t* objects =
                    (binder_size_t*)realloc(mObjects, objectsSize*sizeof(binder_size_t));
                if (objects) {
                    mObjects = objects;
                }
            }
            mObjectsSize = objectsSize;
            mNextObjectHint = 0;
            mObjectsSorted = false;