Revert "[misc] Fix possible resource leak"

This reverts commit c6a5f17eb4b9559d7e9006de0d3fc05e44d73744.