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/ogsf: Fix Resource Leak issue in gp3.c #4977

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
8 changes: 6 additions & 2 deletions lib/ogsf/gp3.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ int Gp_load_sites_thematic(geosite *gp, struct Colors *colors)
int red, blu, grn;
const char *str;
const char *mapset;
char *fname;

dbDriver *driver;
dbValue value;
Expand Down Expand Up @@ -208,8 +209,9 @@ int Gp_load_sites_thematic(geosite *gp, struct Colors *colors)
G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
Fi->database, Fi->driver);
}
G_message(_("Loading thematic points layer <%s>..."),
G_fully_qualified_name(gp->filename, mapset));
fname = G_fully_qualified_name(gp->filename, mapset);
G_message(_("Loading thematic points layer <%s>..."), fname);
G_free(fname);
npts = nskipped = 0;
for (gpt = gp->points; gpt; gpt = gpt->next) {
gpt->style = (gvstyle *)G_malloc(sizeof(gvstyle));
Expand Down Expand Up @@ -295,5 +297,7 @@ int Gp_load_sites_thematic(geosite *gp, struct Colors *colors)
_("%d points without category. "
"Unable to determine color rules for features without category."),
nskipped);
db_close_database_shutdown_driver(driver);
Vect_destroy_field_info(Fi);
return npts;
}
Loading