A term-by-term comparison has been conducted between the residuals of the continuous and discrete adjoint methods for quasi-1D flow equations. This comparison is done to identify the origin of numerical instabilities near boundaries of the discrete adjoint method. The results show that there is one-to-one correspondence between the terms of the two residuals. Furthermore, the adjoint boundary conditions are rigorously analyzed. It turns out that improvement can be achieved by replacing some of the terms of the discrete adjoint residual with the counterparts in the continuous adjoint method.