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

Commit 14ec0809 authored by Christopher Ferris's avatar Christopher Ferris
Browse files

Close native handle properly.

Bug: 229900304

Test: No leaks from this location.
Change-Id: Ib2618b0a5b55be648d0f12536e84a3a1b355b660
parent 5514be66
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1245,8 +1245,9 @@ status_t Gralloc4Allocator::allocate(std::string requestorName, uint32_t width,
        } else {
            if (importBuffers) {
                for (uint32_t i = 0; i < bufferCount; i++) {
                    error = mMapper.importBuffer(makeFromAidl(result.buffers[i]),
                                                 &outBufferHandles[i]);
                    auto handle = makeFromAidl(result.buffers[i]);
                    error = mMapper.importBuffer(handle, &outBufferHandles[i]);
                    native_handle_delete(handle);
                    if (error != NO_ERROR) {
                        for (uint32_t j = 0; j < i; j++) {
                            mMapper.freeBuffer(outBufferHandles[j]);