Fix mismatched allocation and deallocation

Part of bug #65551
1 file changed