diff options
author | Nathan Huckleberry <nhuck@google.com> | 2019-07-01 23:29:10 +0000 |
---|---|---|
committer | Nathan Huckleberry <nhuck@google.com> | 2019-07-01 23:29:10 +0000 |
commit | 121401425d4d56eb6faed74c0307d161e77f7434 (patch) | |
tree | 07fd451705e87ac3fb599737cf62854e5c98ca34 /clang/test/Analysis/kmalloc-linux.c | |
parent | d66c606a34618b290a66468743044069014d311f (diff) | |
download | bcm5719-llvm-121401425d4d56eb6faed74c0307d161e77f7434.tar.gz bcm5719-llvm-121401425d4d56eb6faed74c0307d161e77f7434.zip |
[analyzer] Support kfree in MallocChecker
Summary:
kmalloc is freed with kfree in the linux kernel. kmalloc support was
added in r204832, but kfree was not. Adding kfree fixes incorrectly
detected memory leaks.
Reviewers: NoQ, nickdesaulniers, dcoughlin, Szelethus
Reviewed By: NoQ, Szelethus
Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64030
llvm-svn: 364875
Diffstat (limited to 'clang/test/Analysis/kmalloc-linux.c')
-rw-r--r-- | clang/test/Analysis/kmalloc-linux.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/Analysis/kmalloc-linux.c b/clang/test/Analysis/kmalloc-linux.c index bac71388a7a..f183446bc06 100644 --- a/clang/test/Analysis/kmalloc-linux.c +++ b/clang/test/Analysis/kmalloc-linux.c @@ -24,7 +24,7 @@ void test_zeroed() { t = list[i]; foo(t); } - free(list); // no-warning + kfree(list); // no-warning } void test_nonzero() { @@ -39,7 +39,7 @@ void test_nonzero() { t = list[i]; // expected-warning{{undefined}} foo(t); } - free(list); + kfree(list); } void test_indeterminate(int flags) { @@ -54,5 +54,5 @@ void test_indeterminate(int flags) { t = list[i]; // expected-warning{{undefined}} foo(t); } - free(list); + kfree(list); } |