This reverts commit c0d6f85e. The asan bot detected a memory leak after this patch. Revert it for now.