Language:
كتاب الاعتصام بالكتاب والسنة
96  
Holding Fast to the Qur'an and Sunnah
(12)
Chapter: Comparing an ambiguous situation to a clear well-defined one
(12)
بَابُ مَنْ شَبَّهَ أَصْلاً مَعْلُومًا بِأَصْلٍ مُبَيَّنٍ قَدْ بَيَّنَ اللَّهُ حُكْمَهُمَا، لِيُفْهِمَ السَّائِلَ
Sahih al-Bukhari 7315

Narrated Ibn `Abbas:

A woman came to the Prophet (ﷺ) and said, "My mother vowed to perform the Hajj but she died before performing it. Should I perform the Hajj on her behalf?" He said, "Yes! Perform the Hajj on her behalf. See, if your mother had been in debt, would you have paid her debt?" She said, "Yes." He said, "So you should pay what is for Him as Allah has more right that one should fulfill one's obligations to Him. "

حَدَّثَنَا مُسَدَّدٌ، حَدَّثَنَا أَبُو عَوَانَةَ، عَنْ أَبِي بِشْرٍ، عَنْ سَعِيدِ بْنِ جُبَيْرٍ، عَنِ ابْنِ عَبَّاسٍ، أَنَّ امْرَأَةً، جَاءَتْ إِلَى النَّبِيِّ صلى الله عليه وسلم فَقَالَتْ إِنَّ أُمِّي نَذَرَتْ أَنْ تَحُجَّ فَمَاتَتْ قَبْلَ أَنْ تَحُجَّ أَفَأَحُجَّ عَنْهَا قَالَ ‏"‏ نَعَمْ حُجِّي عَنْهَا، أَرَأَيْتِ لَوْ كَانَ عَلَى أُمِّكِ دَيْنٌ أَكُنْتِ قَاضِيَتَهُ ‏"‏‏.‏ قَالَتْ نَعَمْ‏.‏ فَقَالَ ‏"‏ فَاقْضُوا الَّذِي لَهُ، فَإِنَّ اللَّهَ أَحَقُّ بِالْوَفَاءِ ‏"‏‏.‏
Reference : Sahih al-Bukhari 7315
In-book reference : Book 96, Hadith 46
USC-MSA web (English) reference : Vol. 9, Book 92, Hadith 418
  (deprecated numbering scheme)