NRT Technology Interview Question

write a new malloc function which can detect the overflow of the memory allocation.