blob: 3dcfae8f0a296118d4c98c4885ea211695ef3d2b [file] [log] [blame]
#include <stdlib.h>
void *
calls_malloc (void)
{
void *result = malloc (1024);
return result;
}
void
calls_free (void *victim)
{
free (victim); /* { dg-warning "double-'free' of 'victim'" } */
/* TODO: this would be better emitted at the callsite,
for such a simple wrapper. */
}
void test (void)
{
void *ptr = calls_malloc ();
calls_free (ptr);
calls_free (ptr); /* BUG: double-'free'. */
}