Fixes some USE_AFTER_FREE

At least Clang agrees on that.