p_reg is never NULL with a vlc_list and we don't have access to the iterator outside of the loop.
p_reg
vlc_list