From 3bd575edb416a23bd0d7288f9eb44297ac26e624 Mon Sep 17 00:00:00 2001 From: Pierre GRANDIN Date: Wed, 26 Aug 2015 16:44:28 -0700 Subject: Fixed trac 1316, Use-after-free bug in binfile.c --- navit/map/binfile/binfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'navit/map') diff --git a/navit/map/binfile/binfile.c b/navit/map/binfile/binfile.c index 5d2cf172e..4ca4c6bf5 100644 --- a/navit/map/binfile/binfile.c +++ b/navit/map/binfile/binfile.c @@ -2129,7 +2129,6 @@ binmap_search_new(struct map_priv *map, struct item *item, struct attr *search, town = map_rect_get_item_byid_binfile(map_rec, map->last_searched_town_id_hi, map->last_searched_town_id_lo); if (town) msp->mr = binmap_search_street_by_place(map, town, &c, &msp->ms, &msp->boundaries); - map_rect_destroy_binfile(map_rec); if (msp->boundaries) dbg(lvl_debug, "using map town boundaries\n"); if (!msp->boundaries && town) @@ -2138,6 +2137,7 @@ binmap_search_new(struct map_priv *map, struct item *item, struct attr *search, if (msp->boundaries) dbg(lvl_debug, "using estimated boundaries\n"); } + map_rect_destroy_binfile(map_rec); /* start searching in area around the street segment even if town boundaries are available */ msp->mr=binmap_search_housenumber_by_estimate(map, &c, &msp->ms); msp->mode = 2; -- cgit v1.2.1