[client] fix memory leak introduced in 0ff210099