#include #include #include void cleanup (int status, void *to_free, ...) { printf ("%x\n", to_free); va_list ap; va_start (ap, to_free); while (to_free) free (to_free); va_end (ap); exit (status); } int main (int argc, char *argv []) { int *i; i = (int *) malloc (10); printf ("%x\n", i); cleanup (EXIT_SUCCESS, i); return 0; }