1 /* { dg-do compile } */
2 /* { dg-options "-fdiagnostics-path-format=separate-events" } */
6 void *wrapped_malloc (size_t size
)
11 void wrapped_free (void *ptr
)
13 free (ptr
); /* { dg-warning "double-free of 'ptr' \\\[CWE-415\\]" } */
16 typedef struct boxed_int
22 make_boxed_int (int i
)
24 boxed_int
*result
= (boxed_int
*)wrapped_malloc (sizeof (boxed_int
));
30 free_boxed_int (boxed_int
*bi
)
36 { /* { dg-message "\\(1\\) entering 'test'" } */
37 boxed_int
*obj
= make_boxed_int (i
); /* { dg-message "\\(2\\) calling 'make_boxed_int'" } */