HW2:task3:dealed with memory leak