Fix deallocation issue for killed processes