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

Commit 1f62b945 authored by John Eckerdal's avatar John Eckerdal Committed by android-build-merger
Browse files

Merge \"Fixed file descriptor leak in IMemory\" into nyc-dev

am: a13a2264

Change-Id: Id692c99cbe9274e51f6d65cb38b3e0a7293e7518
parents 9bcbc8c8 a13a2264
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -312,6 +312,8 @@ void BpMemoryHeap::assertReallyMapped() const
                IInterface::asBinder(this).get(),
                parcel_fd, size, err, strerror(-err));

        Mutex::Autolock _l(mLock);
        if (mHeapId == -1) {
            int fd = dup( parcel_fd );
            ALOGE_IF(fd==-1, "cannot dup fd=%d, size=%zd, err=%d (%s)",
                    parcel_fd, size, err, strerror(errno));
@@ -321,8 +323,6 @@ void BpMemoryHeap::assertReallyMapped() const
                access |= PROT_WRITE;
            }

        Mutex::Autolock _l(mLock);
        if (mHeapId == -1) {
            mRealHeap = true;
            mBase = mmap(0, size, access, MAP_SHARED, fd, offset);
            if (mBase == MAP_FAILED) {