If I have a function like this:
void bla(int size) { while(b){ char tmp[size]; ...... } }
tmp gets freed at each it
alloca allocates on the stack and has no knowledge about scopes, so it gets freed after leaving the stack frame (= after leaving the function).
alloca