client - memory leak fix