diff options
author | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2012-11-09 21:59:52 +0000 |
---|---|---|
committer | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2012-11-09 21:59:52 +0000 |
commit | 8f2a5742605d56049aa8ca371877b30f19bae44b (patch) | |
tree | 1e062c579d57281f60d2a13fad444651ee3f3590 /navit/navigation.c | |
parent | 92af8942a839d4f38f08ca7f9e618d21390f320a (diff) | |
download | navit-8f2a5742605d56049aa8ca371877b30f19bae44b.tar.gz |
Fix:Core:Few memleaks
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5263 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/navigation.c')
-rw-r--r-- | navit/navigation.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/navit/navigation.c b/navit/navigation.c index fed6582a5..8fa1a8740 100644 --- a/navit/navigation.c +++ b/navit/navigation.c @@ -639,6 +639,7 @@ navigation_itm_ways_update(struct navigation_itm *itm, struct map *graph_map) i = map_rect_get_item(g_rect); if (!i || i->type != type_rg_point) { // probably offroad? + map_rect_destroy(g_rect); return ; } @@ -829,8 +830,11 @@ navigation_itm_new(struct navigation *this_, struct item *ritem) ret->way.item=*sitem; item_hash_insert(this_->hash, sitem, ret); mr=map_rect_new(sitem->map, NULL); - if (! (sitem=map_rect_get_item_byid(mr, sitem->id_hi, sitem->id_lo))) + if (! (sitem=map_rect_get_item_byid(mr, sitem->id_hi, sitem->id_lo))) { + g_free(ret); + map_rect_destroy(mr); return NULL; + } if (item_attr_get(sitem, attr_street_name, &attr)) ret->way.name1=map_convert_string(sitem->map,attr.u.str); if (item_attr_get(sitem, attr_street_name_systematic, &attr)) |