Forgot to free tempSurf; fixed.