Add missing zstd.h to coregrind Makefile.am noinst_HEADERS
[valgrind.git] / memcheck / tests / mismatches.cpp
blob252fe7d7b586d355125ab900ef4bc081ba57770e
1 #include <stdlib.h>
3 int main()
5 int* fpointer = (int*)malloc(10);
6 delete fpointer; // should give warning (or two if sized delete is used)
7 fpointer = (int*)malloc(10);
8 delete [] fpointer; // should give warning
9 fpointer = (int*)malloc(10);
10 free (fpointer); // should work!
12 int* nvec = new int[10];
13 delete nvec; // should give a warning (or two if sized delete is used)
14 nvec = new int[10];
15 free (nvec); // should give a warning
16 nvec = new int[10];
17 delete [] nvec; // should work!
19 int* n = new int;
20 delete [] n; // should give a warning
21 n = new int;
22 free(n); // should give a warning
23 n = new int;
24 delete n; // should work!
26 return 0;