#include void test(int n) { int buf[10]; int *ptr; if (n < 10) ptr = buf; else ptr = (int *)malloc(sizeof (int) * n); /* do stuff. */ /* oops; this free should be conditionalized. */ free(ptr); } int main(int argc, char **argv) { test(argc); }