Revert "fix memory leak"

This reverts commit eb6cc3eef610459d277ab931a2f4a0223438370f.