summaryrefslogtreecommitdiff
path: root/navit/mapset.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-05-31 18:50:32 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-05-31 18:50:32 +0000
commit8411100161a364e1c39beb3bd7256b246d1974f5 (patch)
tree1a5e5ebf866033ea85a0f1cd818d433102c4bc81 /navit/mapset.c
parent92007982bd2c0e22e9f7d565eeaea607d57e2c2f (diff)
downloadnavit-8411100161a364e1c39beb3bd7256b246d1974f5.tar.gz
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
Diffstat (limited to 'navit/mapset.c')
-rw-r--r--navit/mapset.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/navit/mapset.c b/navit/mapset.c
index 5c805cbb4..1d610e0fd 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);
+ }
}