Intertemporal choice with possibility of death
It is safe to assume that if the consumer passes away, his creditors get his endowment. This actually happens in real life. $B$ should obviously be zero. As far as the second period is concerned you can represent it as a von Neuman-Morgenstern utility from the lottery:

$\beta u(c_2)$ with probability $p$ and $0$ with probability $1-p$.

I.e. $U(c_1, c_2) = log(c_1) + p\beta log(c_2).$