diff options
author | Kamil Rytarowski <n54@gmx.com> | 2019-09-21 07:43:55 +0000 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2019-09-21 07:43:55 +0000 |
commit | 5fe1e55d35413b1904cfcf16ec15495398921fe5 (patch) | |
tree | 86a02f00b8943dbdaf5369e4faae74d6b36dfefd /compiler-rt/test/asan | |
parent | 8827047551570b7ed7088765c3de2a8cce6823b8 (diff) | |
download | bcm5719-llvm-5fe1e55d35413b1904cfcf16ec15495398921fe5.tar.gz bcm5719-llvm-5fe1e55d35413b1904cfcf16ec15495398921fe5.zip |
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
llvm-svn: 372460
Diffstat (limited to 'compiler-rt/test/asan')
-rw-r--r-- | compiler-rt/test/asan/TestCases/inline.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler-rt/test/asan/TestCases/inline.cpp b/compiler-rt/test/asan/TestCases/inline.cpp index daeb7b49eb2..12bd27e6758 100644 --- a/compiler-rt/test/asan/TestCases/inline.cpp +++ b/compiler-rt/test/asan/TestCases/inline.cpp @@ -13,6 +13,7 @@ int f(int *p) { 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; |