Add memory leak checking for Index and RingBuf.