client: fix possible leak