Revert "fix potential memory leak in dynarray"

This reverts commit 8dc2b37940f62e210eeba0d198c862ac3b3f78d0.