Fix network memory leak