TONY: Fix potential memory leak

Unfortunately, I'm not sure where and when this function is called.
But this should be correct. CID 1003575