mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 08:20:12 +01:00
panfrost: Fix memory leaks on unit test failures.
Change ASSERT_EQ to EXPECT_EQ to avoid aborting before freeing memory.
Fix defects reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable tiled going out of scope leaks the storage it points to.
leaked_storage: Variable linear going out of scope leaks the storage it points to.
leaked_storage: Variable ref going out of scope leaks the storage it points to.
Fixes: bb6c14a697 ("panfrost: Unit test u-interleaved tiling routines")
Suggested-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16127>
This commit is contained in:
parent
f5bc062ffd
commit
7898721cce
1 changed files with 2 additions and 2 deletions
|
|
@ -160,9 +160,9 @@ test(unsigned width, unsigned height, unsigned rx, unsigned ry,
|
|||
dst_stride, src_stride, format, store);
|
||||
|
||||
if (store)
|
||||
ASSERT_EQ(memcmp(ref, tiled, bpp * tiled_width * tiled_height), 0);
|
||||
EXPECT_EQ(memcmp(ref, tiled, bpp * tiled_width * tiled_height), 0);
|
||||
else
|
||||
ASSERT_EQ(memcmp(ref, linear, bpp * rw * linear_stride), 0);
|
||||
EXPECT_EQ(memcmp(ref, linear, bpp * rw * linear_stride), 0);
|
||||
|
||||
free(ref);
|
||||
free(tiled);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue