util: Fix memory leaks in unit test.
Fix warnings reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable bt1 going out of scope leaks the storage
it points to.
leaked_storage: Variable bt2 going out of scope leaks the storage
it points to.
Fixes: d0d14f3f64 ("util: Add unit test for stack backtrace caputure")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6246>
This commit is contained in:
@@ -106,6 +106,9 @@ TEST(u_debug_stack_test, capture_not_overwritten)
|
||||
if (size > 0) {
|
||||
EXPECT_STRNE(bt1, bt2);
|
||||
}
|
||||
|
||||
free(bt1);
|
||||
free(bt2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user