Skip to content

Commit

Permalink
lib/raster: Fix Resource Leak issue in quant_io.c (#5076)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShubhamDesai authored Feb 9, 2025
1 parent d861511 commit dc6e4c1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/raster/quant_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ int Rast__quant_import(const char *name, const char *mapset,
Rast_quant_free(quant);

if (Rast_map_type(name, mapset) == CELL_TYPE) {
char *mname = G_fully_qualified_name(name, mapset);
G_warning(_("Attempt to open quantization"
" table for CELL raster map <%s>"),
G_fully_qualified_name(name, mapset));
mname);
G_free(mname);
return -2;
}

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

/* int range doesn't exist anymore if (quant_load_range (quant, name,
* mapset)>0) return 3; */
G_warning(_("Quantization file for raster map <%s> is missing"),
G_fully_qualified_name(name, mapset));
char *mname = G_fully_qualified_name(name, mapset);
G_warning(_("Quantization file for raster map <%s> is missing"), mname);
G_free(mname);
}
else {
parsStat = quant_parse_file(fd, quant);
Expand Down

0 comments on commit dc6e4c1

Please sign in to comment.