fix heap leak.