Fixed memory leaks in the new ip matching routines