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
commite38b4211a9cf84dc6b6e7b8d1f36a059f5ca9183 (patch)
tree1a5e5ebf866033ea85a0f1cd818d433102c4bc81 /navit/mapset.c
parentd973fe78c6a0e117eccfb6e02a9deab997fe92a4 (diff)
downloadnavit-svn-e38b4211a9cf84dc6b6e7b8d1f36a059f5ca9183.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 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);
+ }
}