Memory-safe code cannot index past an array, use freed memory or free it twice. Rust enforces this at compile time in safe code, Go and most managed languages with runtime checks and a garbage collector. C leaves it to the programmer. See buffer overflow and use-after-free.