Fixed #4611 (Resource leak not found (was: Reverse NULL check))