1 | #include <stdio.h> |
---|---|
2 | #include <stdlib.h> |
3 | |
4 | char *pointer; |
5 | char *another_pointer; |
6 | |
7 | void f1() { |
8 | pointer = malloc(size: 10); // malloc line |
9 | another_pointer = malloc(size: 20); // malloc2 line |
10 | } |
11 | |
12 | void f2() { |
13 | free(ptr: pointer); // free line |
14 | } |
15 | |
16 | int main (int argc, char const *argv[]) |
17 | { |
18 | f1(); |
19 | f2(); |
20 | |
21 | printf(format: "Hello world!\n"); // break line |
22 | |
23 | pointer[0] = 'A'; // BOOM line |
24 | |
25 | return 0; |
26 | } |
27 |