You should free it in mailimap_search_key_free().