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.
Memory safety
A language or tool guarantee that a program cannot read or write memory it does not own.