1 //===-- main.c --------------------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 #include <stdio.h> 9 #include <stdlib.h> 10 11 char *pointer; 12 char *another_pointer; 13 14 void f1() { 15 pointer = malloc(10); // malloc line 16 another_pointer = malloc(20); // malloc2 line 17 } 18 19 void f2() { 20 free(pointer); // free line 21 } 22 23 int main (int argc, char const *argv[]) 24 { 25 f1(); 26 f2(); 27 28 printf("Hello world!\n"); // break line 29 30 pointer[0] = 'A'; // BOOM line 31 32 return 0; 33 } 34