[PATCHv2] client: Fix Memory Leak