Skip to content

Commit 4e3e14c

Browse files
authored
lib/vector/Vlib: Fix Resource Leak issue in open_nat.c (#5080)
1 parent 1c93c80 commit 4e3e14c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/vector/Vlib/open_nat.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ int V1_open_old_nat(struct Map_info *Map, int update)
5353
Map->dig_fp.file = G_fopen_old(path, GV_COOR_ELEMENT, Map->mapset);
5454

5555
if (Map->dig_fp.file == NULL) {
56-
G_warning(_("Unable to open coor file for vector map <%s>"),
57-
Vect_get_full_name(Map));
56+
const char *map_name = Vect_get_full_name(Map);
57+
G_warning(_("Unable to open coor file for vector map <%s>"), map_name);
58+
G_free((void *)map_name);
5859
return -1;
5960
}
6061

0 commit comments

Comments
 (0)