commit | 54f5dca4b6446825d51b1d0b4bd313079dbfda70 | [log] [tgz] |
---|---|---|
author | Kamil Rytarowski <n54@gmx.com> | Sat Sep 21 07:43:55 2019 +0000 |
committer | Kamil Rytarowski <n54@gmx.com> | Sat Sep 21 07:43:55 2019 +0000 |
tree | b13c1a65c42365a9fd5da0cba6e8caa09e6ad0e6 | |
parent | 96b852a95bebc7c2d9da09975a4764c365167621 [diff] |
Avoid memory leak in ASan test Summary: Add missing free(3) for the malloc(3) call. Detected on NetBSD with LSan. Reviewers: joerg, mgorny, vitalybuka, dvyukov Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67330 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@372460 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/asan/TestCases/inline.cpp b/test/asan/TestCases/inline.cpp index daeb7b4..12bd27e 100644 --- a/test/asan/TestCases/inline.cpp +++ b/test/asan/TestCases/inline.cpp
@@ -13,6 +13,7 @@ int main(int argc, char **argv) { int * volatile x = (int*)malloc(2*sizeof(int) + 2); int res = f(x + 2); + free(x); if (res) exit(0); return 0;