From 21ec0fde178b8575e8f08290490a73701fb7ee29 Mon Sep 17 00:00:00 2001 From: martin-s Date: Sun, 2 May 2010 15:00:54 +0000 Subject: [PATCH] Fix:maptool:Don't crash on NULL strings git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3220 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/navit/maptool/misc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/navit/navit/maptool/misc.c b/navit/navit/maptool/misc.c index 73c3d95..541a46f 100644 --- a/navit/navit/maptool/misc.c +++ b/navit/navit/maptool/misc.c @@ -113,8 +113,10 @@ phase1_map(GList *maps, FILE *out_ways, FILE *out_nodes) while (item_attr_get(item, attr_any, &attr)) { if (attr.type >= attr_type_string_begin && attr.type <= attr_type_string_end) { attr.u.str=map_convert_string(maps->data, attr.u.str); - item_bin_add_attr(item_bin, &attr); - map_convert_free(attr.u.str); + if (attr.u.str) { + item_bin_add_attr(item_bin, &attr); + map_convert_free(attr.u.str); + } } else item_bin_add_attr(item_bin, &attr); } -- 2.7.4