We propose a unified structural credit risk model incorporating both insolvency and illiquidity risks, in order to investigate how a firms default probability depends on the liquidity risk associated with its financing structure. We assume the firm finances its risky assets by mainly issuing short- and long-term debt. Short-term debt can have either a discrete or a more realistic staggered tenor structure. At rollover dates of short-term debt, creditors face a dynamic coordination problem. We show that a unique threshold strategy (i.e., a debt run barrier) exists for short-term creditors to decide when to withdraw their funding, and this strategy is closely related to the solution of a non-standard optimal stopping time problem with control constraints. We decompose the total credit risk into an insolvency component and an illiquidity component based on such an endogenous debt run barrier together with an exogenous insolvency barrier.