Skip to content

Commit 5fe1e55

Browse files
committed
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
1 parent 8827047 commit 5fe1e55

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler-rt/test/asan/TestCases/inline.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ int f(int *p) {
1313
int main(int argc, char **argv) {
1414
int * volatile x = (int*)malloc(2*sizeof(int) + 2);
1515
int res = f(x + 2);
16+
free(x);
1617
if (res)
1718
exit(0);
1819
return 0;

0 commit comments

Comments
 (0)