fix double free for two character search