Revert "Fixed possible memory leak"

This reverts commit 61903cfc250b154d63f385021b512212d2164ac5.