memory alloc: change malloc example to alloca example

This example suits alloca better because the allocation size
is small and all dynamic allocation occurs in just one place.