fix leak with attributes, always make sure the list if deleted
use alloca where applicable for niceness ;-)