| File: | invalidwarning.c |
| Location: | line 11, column 2 |
| Description: | Use of memory after it is freed |
| 1 | #include <stdlib.h> | |||
| 2 | #include <stdio.h> | |||
| 3 | ||||
| 4 | int main(void) { | |||
| 5 | int *p; | |||
| 6 | p = malloc(sizeof(int)); | |||
| ||||
| 7 | *p = 1; | |||
| 8 | ||||
| 9 | printf("%d %p\n", *p, (void *)p); | |||
| 10 | free(p); | |||
| 11 | printf("%p\n", (void *)p); | |||
| ||||
| 12 | return 0; | |||
| 13 | } | |||
| 14 |