client: fix json leak