Fix memory leak with network system.

Based off iChunUtil