cppcheck/test/testsuites/duma/wrong1.c

14 lines
225 B
C
Raw Normal View History

2019-03-18 06:58:12 +01:00
#include <stdio.h>
int main() {
printf("Hello world!\n");
int* pI = (int*)malloc(sizeof(int));
*pI=2;
free(pI);
printf("Now freeing a pointer twice...\n");
free(pI);
printf("Did you notice?\n");
return 0;
}