From 1f5642dd20efe1f8a0e20c3e588e800e1130e4d9 Mon Sep 17 00:00:00 2001 From: mdankov Date: Wed, 13 Jun 2012 20:05:21 +0000 Subject: [PATCH] Fix:core:Memleak while navigating. git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@5141 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/navit/route.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/navit/navit/route.c b/navit/navit/route.c index 4a9f3c9..60aaafd 100644 --- a/navit/navit/route.c +++ b/navit/navit/route.c @@ -714,6 +714,8 @@ route_path_update_done(struct route *this, int new_graph) this->path2=route_path_new(this->graph, NULL, prev_dst, this->current_dst, this->vehicleprofile); if (this->path2) this->path2->next=oldpath; + else + route_path_destroy(oldpath,0); } else { this->path2=route_path_new(this->graph, oldpath, prev_dst, this->current_dst, this->vehicleprofile); if (oldpath && this->path2) { @@ -1636,7 +1638,7 @@ route_path_add_line(struct route_path *this, struct coord *start, struct coord * static int route_path_add_item_from_graph(struct route_path *this, struct route_path *oldpath, struct route_graph_segment *rgs, int dir, struct route_info *pos, struct route_info *dst) { - struct route_path_segment *segment; + struct route_path_segment *segment=NULL; int i, ccnt, extra=0, ret=0; struct coord *c,*cd,ca[2048]; int offset=1; @@ -1655,6 +1657,7 @@ route_path_add_item_from_graph(struct route_path *this, struct route_path *oldpa if (!pos) goto linkold; } + g_free(segment); } } -- 2.7.4