Remove useless getCompFromResName()
Remove useless statRefStart(), statType() and componentType().
Fix two memory leaks