All pastes #12097 Raw Edit

Unnamed

public text v1 · immutable
#12097 ·published 2005-05-18 20:40 UTC
rendered paste body
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

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;
}