fixed memory leak in network stack