Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib/raster: Fix Resource Leak issue in quant_io.c #5076

Merged
merged 2 commits into from
Feb 9, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/raster/quant_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ 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));
" table for CELL raster map <%s>"), mname);
ShubhamDesai marked this conversation as resolved.
Show resolved Hide resolved
G_free(mname);
return -2;
}

Expand Down Expand Up @@ -133,8 +134,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
Loading