Don't __free_sm_state() until end of function.