Free memory after building equation