Skip to content

Commit dc6e4c1

Browse files
authored
lib/raster: Fix Resource Leak issue in quant_io.c (OSGeo#5076)
1 parent d861511 commit dc6e4c1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/raster/quant_io.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ int Rast__quant_import(const char *name, const char *mapset,
103103
Rast_quant_free(quant);
104104

105105
if (Rast_map_type(name, mapset) == CELL_TYPE) {
106+
char *mname = G_fully_qualified_name(name, mapset);
106107
G_warning(_("Attempt to open quantization"
107108
" table for CELL raster map <%s>"),
108-
G_fully_qualified_name(name, mapset));
109+
mname);
110+
G_free(mname);
109111
return -2;
110112
}
111113

@@ -133,8 +135,9 @@ int Rast__quant_import(const char *name, const char *mapset,
133135

134136
/* int range doesn't exist anymore if (quant_load_range (quant, name,
135137
* mapset)>0) return 3; */
136-
G_warning(_("Quantization file for raster map <%s> is missing"),
137-
G_fully_qualified_name(name, mapset));
138+
char *mname = G_fully_qualified_name(name, mapset);
139+
G_warning(_("Quantization file for raster map <%s> is missing"), mname);
140+
G_free(mname);
138141
}
139142
else {
140143
parsStat = quant_parse_file(fd, quant);

0 commit comments

Comments
 (0)