Temperature dependence of spin-transport properties and spin torque in a magnetic nanostructure