Fix source of double free error in clean_outlinks()