Memory access errors are a major source of bugs in programs written in C. The errors are difficult to find and can lead to runtime failures or even security compromises. Languages such as Java are free from such errors because of their strong type-checking mechanisms. We propose a method to achieve many of the memory safety features in these type-safe languages without changing the C language or rewriting source code. Our approach is based on the safety rule that a memory variable should only be updated by the small set of instructions intended by the programmer. Any deviation from the safety rule is considered a violation. The proposed method is implemented using static program slicing techniques and runtime memory access monitoring. Our method can be used for detecting memory corruption attacks, identifying bugs during software development, and diagnosing memory-related failures post-mortem.