free memory after string compare