From: Vinson Lee Date: Sun, 9 Aug 2020 04:26:12 +0000 (-0700) Subject: util: Fix memory leaks in unit test. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=96cfc684e63238a7aeabc8893fb04fe5f3781a66;p=mesa.git 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: d0d14f3f6481 ("util: Add unit test for stack backtrace caputure") Signed-off-by: Vinson Lee Reviewed-by: Kristian H. Kristensen Part-of: --- diff --git a/src/util/u_debug_stack_test.cpp b/src/util/u_debug_stack_test.cpp index b5f8ea4ba38..6add3e989b2 100644 --- a/src/util/u_debug_stack_test.cpp +++ b/src/util/u_debug_stack_test.cpp @@ -106,6 +106,9 @@ TEST(u_debug_stack_test, capture_not_overwritten) if (size > 0) { EXPECT_STRNE(bt1, bt2); } + + free(bt1); + free(bt2); } #endif