Hotfixing memory corruption upon port cleaning