Fixed #5778 (False positive: Deallocating a deallocated pointer when exit function is called)