Revert "Fix memory leak"

This reverts commit 591b923082251ec77f8daeaa2db1208215a55993.
Fix memory leak

(cherry picked from commit da2ed23fc493a5b28c545bdc5a71fc178aa01ba6)