r14430: ret can be NULL at the end of this loop