Valmiki Ramayana Kishkindha Kanda Sarga 25 Shloka 10
Original Shlokaस्वधर्मस्य च संयोगाज्जितस्तेन महात्मना। स्वर्गः परिगृहीतश्च प्राणानपरिरक्षता4.25.10।।
1 source checked for this shloka
प्राणान् life, अपरिरक्षिता by not protecting, तेन महात्मना by that great soul, स्वधर्मस्य सम्योगात् by virtue of his own dharma, स्वर्गः heaven, जितः won, परिगृहीतश्च has been accepted.
'Great Vali has earned a place in heaven by virtue of his own dharma and not caring for his own life .He has got the heavenly position he earned.