blob: b5c7a87e15bcec2b81a44fa9648e0d11aff81192 [file] [log] [blame]
/* Double free a union with the free() function called from
a function pointer within the union. */
#include <stdlib.h>
union test {
void (*free_func)(void *);
int value;
};
int main()
{
union test *t;
t = malloc(sizeof(union test));
t->free_func = free;
t->free_func(t);
free(t);
return 0;
}