This paper studies optimal defined-contribution (DC) pension management under stochastic interest rates and expected inflation. In addition to financial risk, we consider the risk of pre-retirement death and introduce life insurance to the pension account as an option to manage this risk. We formulate this pension management problem as a random horizon utility maximization problem and derive its explicit solution under the assumption of constant relative risk aversion utility. We calibrate our model to the U.S. data and demonstrate that the pension member’s demand for life insurance has a hump-shaped pattern with age and a U-shaped pattern with the real interest rate and expected inflation. The optimal pension account balance in our model resembles a variable annuity, wherein the death benefits are endogenously determined and depend on various factors including age, mortality, account balance, future contributions, preferences, and market conditions. Our study suggests that offering variable annuities with more flexible death benefits within the DC account could better cater to the bequest demands of its members.