1 // REQUIRES: static-analyzer 2 // RUN: clang-tidy %s -checks='-*,clang-analyzer-*' -- | FileCheck %s 3 extern void *malloc(unsigned long); 4 extern void free(void *); 5 f()6void f() { 7 int *p = new int(42); 8 delete p; 9 delete p; 10 // CHECK: warning: Attempt to free released memory [clang-analyzer-cplusplus.NewDelete] 11 } 12 g()13void g() { 14 void *q = malloc(132); 15 free(q); 16 free(q); 17 // CHECK: warning: Attempt to free released memory [clang-analyzer-unix.Malloc] 18 } 19