fixed memory leakly, add reg_list testcase