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

Commit a13a2264 authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

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

parents 324b700b 6b0b0634
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) {