alloca() allocates memory on the stack rather than on the heap, as in the case of malloc(). So, when I return from the routine the memory is freed.
As noted in this newsgroup posting, there are a few reasons why using alloca can be considered difficult and dangerous:
alloca.alloca differently, so portability is not guaranteed even between compilers that support it.