Home | History | Annotate | Download | only in tests
      1 
      2 #include <stdlib.h>
      3 
      4 void ddd ( char* x )
      5 {
      6   free(x);
      7   free(x);
      8 }
      9 
     10 void ccc (char* x)
     11 {
     12   ddd(x);
     13 }
     14 
     15 void bbb (char* x)
     16 {
     17   ccc(x);
     18 }
     19 
     20 void aaa (char* x)
     21 {
     22   bbb(x);
     23 }
     24 
     25 void ok_to_suppress_double_free_from_this_fun(char* y)
     26 {
     27   aaa(y);
     28 }
     29 
     30 int main ( int argc, char*argv[] )
     31 {
     32    char* x = malloc(10);
     33    char* y = malloc(10);
     34    if (argc > 1)
     35       ok_to_suppress_double_free_from_this_fun(y);
     36    aaa(x);
     37    return 0;
     38 }
     39