Hadith 504590
Chapter 14: The Qibla - كتاب القبلة
وَحَدَّثَنِي عَنْ مَالِكٍ، عَنْ نَافِعٍ، عَنْ رَجُلٍ، مِنَ الأَنْصَارِ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم نَهَى أَنْ تُسْتَقْبَلَ الْقِبْلَةُ لِغَائِطٍ أَوْ بَوْلٍ .
Yahya related to me from Malik from one of the Ansar that the Messenger of Allah, may Allah bless him and grant him peace, forbade defecating or urinating while facing the qibla.
Reference Muwatta Malik 504590
USC-MSA web (English) reference : Book 14, Hadith 2