memory safe patch