[PATCH] D23375: Add kfree( ) to MallocChecker.cpp

Andrew Wells via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 10 14:42:09 PDT 2016


andrewmw94 updated this revision to Diff 67610.
andrewmw94 added a comment.

Change the test file kmalloc-linux.c to use kfree( ).  Sorry if there was a way to put both patch files together; I wasn't able to find one.


Repository:
  rL LLVM

https://reviews.llvm.org/D23375

Files:
  kmalloc-linux.c

Index: kmalloc-linux.c
===================================================================
--- kmalloc-linux.c
+++ kmalloc-linux.c
@@ -6,6 +6,7 @@
 #define NULL ((void *)0)
 
 void *kmalloc(size_t, int);
+void *kfree(size_t);
 
 struct test {
 };
@@ -24,7 +25,7 @@
     t = list[i];
     foo(t);
   }
-  free(list); // no-warning
+  kfree(list); // no-warning
 }
 
 void test_nonzero() {
@@ -39,7 +40,7 @@
     t = list[i]; // expected-warning{{undefined}}
     foo(t);
   }
-  free(list);
+  kfree(list);
 }
 
 void test_indeterminate(int flags) {
@@ -54,5 +55,5 @@
     t = list[i]; // expected-warning{{undefined}}
     foo(t);
   }
-  free(list);
+  kfree(list);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23375.67610.patch
Type: text/x-patch
Size: 670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160810/ad90460f/attachment.bin>


More information about the cfe-commits mailing list