projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8827047
)
Avoid memory leak in ASan test
author
Kamil Rytarowski
<n54@gmx.com>
Sat, 21 Sep 2019 07:43:55 +0000
(07:43 +0000)
committer
Kamil Rytarowski
<n54@gmx.com>
Sat, 21 Sep 2019 07:43:55 +0000
(07:43 +0000)
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
compiler-rt/test/asan/TestCases/inline.cpp
patch
|
blob
|
history
diff --git
a/compiler-rt/test/asan/TestCases/inline.cpp
b/compiler-rt/test/asan/TestCases/inline.cpp
index
daeb7b4
..
12bd27e
100644
(file)
--- 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;