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

Commit 4f65d337 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents b0406010 6af27a83
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;