network-listener: Fix memory leak