From e38b4211a9cf84dc6b6e7b8d1f36a059f5ca9183 Mon Sep 17 00:00:00 2001 From: martin-s Date: Sat, 31 May 2008 18:50:32 +0000 Subject: Fix:data_binfile:Fixed a few search bugs git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1092 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/mapset.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'navit/mapset.c') diff --git a/navit/mapset.c b/navit/mapset.c index 5c805cbb..1d610e0f 100644 --- a/navit/mapset.c +++ b/navit/mapset.c @@ -97,8 +97,8 @@ mapset_search_new(struct mapset *ms, struct item *item, struct attr *search_attr struct item * mapset_search_get_item(struct mapset_search *this) { - struct item *ret; - while (!(ret=map_search_get_item(this->ms))) { + struct item *ret=NULL; + while (!this->ms || !(ret=map_search_get_item(this->ms))) { if (this->search_attr->type >= attr_country_all && this->search_attr->type <= attr_country_name) break; do { @@ -115,6 +115,8 @@ mapset_search_get_item(struct mapset_search *this) void mapset_search_destroy(struct mapset_search *this) { - map_search_destroy(this->ms); - g_free(this); + if (this) { + map_search_destroy(this->ms); + g_free(this); + } } -- cgit v1.2.1