In this chapter, we delved into a critical area: the fact that the seemingly simple, dynamic memory management APIs can cause deep and difficult-to-detect bugs in real-world fielded systems.
The common classes of memory bugs, such as uninitialized memory usage (UMR), out-of-bounds accesses (read|write underflow|overflow bugs), and the double free, were covered. Memory leakage is a common and dangerous memory bug—we looked at three different cases of it.
The supplied membugs program helps the reader actually see and try out the various memory bugs covered via small test cases. In the next chapter we shall dive into using tools to help identify these dangerous defects.