1 Kings 1:21
Otherwise it shall come to pass, when my lord the king shall sleep with his fathers, that I and my son Solomon shall be counted offenders. Otherwise it shall come to pass, when my lord the king shall sleep with his fathers, that I and my son Solomon shall be counted offenders.
To sleep with his fathers means to die. The danger arose because Adonijah's rebellion threatened the succession that God had appointed for Solomon. Bathsheba was warning David that if he died without securing Solomon's succession, she and her son Solomon would be treated as offenders by those who took power.