Fix buffer leak when using NetServer and NetClient. See BZ-426824