mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
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> (cherry picked from commit96cfc684e6)
This commit is contained in:
parent
6d14d91a80
commit
11edf2e357
2 changed files with 4 additions and 1 deletions
|
|
@ -310,7 +310,7 @@
|
|||
"description": "util: Fix memory leaks in unit test.",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "d0d14f3f6481e015b4413fa0487164b76fe45296"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -106,6 +106,9 @@ TEST(u_debug_stack_test, capture_not_overwritten)
|
|||
if (size > 0) {
|
||||
EXPECT_STRNE(bt1, bt2);
|
||||
}
|
||||
|
||||
free(bt1);
|
||||
free(bt2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue