client: fix free of wrong pointer