Fixing possible memory leak in getTabInfo(). Changes according to the review.