Handle gralloc handle leaks
Delete locked handle from C2AllocatorGralloc.
Delete temporary cloned handle from C2OMXNode.
Bug: 122978854
Change-Id: I6cff2775380e85e4ca83315df06fe59a42e6a4ca
diff --git a/media/codec2/vndk/C2AllocatorGralloc.cpp b/media/codec2/vndk/C2AllocatorGralloc.cpp
index fdea2d3..18f2430 100644
--- a/media/codec2/vndk/C2AllocatorGralloc.cpp
+++ b/media/codec2/vndk/C2AllocatorGralloc.cpp
@@ -316,6 +316,11 @@
native_handle_delete(
const_cast<native_handle_t *>(reinterpret_cast<const native_handle_t *>(mHandle)));
}
+ if (mLockedHandle) {
+ native_handle_delete(
+ const_cast<native_handle_t *>(
+ reinterpret_cast<const native_handle_t *>(mLockedHandle)));
+ }
}
c2_status_t C2AllocationGralloc::map(