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

Commit dcc07561 authored by Amith Yamasani's avatar Amith Yamasani Committed by android-build-merger
Browse files

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

am: a2db19c4

Change-Id: I273e03d7d32b2e4456ef2ce98e30cb047fb2532a
parents 68956e60 a2db19c4
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) {