D is not going to catch memory safety problems that result from using C library functions, like malloc. D can only guarantee memory safety when using D code and D library functions. The programmer is on his own using the unsafe C functions.