summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinson Lee <vlee@freedesktop.org>2020-08-08 21:26:12 -0700
committerVinson Lee <vlee@freedesktop.org>2020-08-11 14:11:01 -0700
commit96cfc684e63238a7aeabc8893fb04fe5f3781a66 (patch)
tree0ada2fb6eb91668c79555e2cb68b71af57b3c5dc
parentef66e02a408c4b8d11a3b7122b0e8e05ffac8eb8 (diff)
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 <vlee@freedesktop.org> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6246>
-rw-r--r--src/util/u_debug_stack_test.cpp3
1 files changed, 3 insertions, 0 deletions
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