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

v.to.rast: Fix Resource Leak issue in do_areas.c #4957

Merged
merged 2 commits into from
Jan 16, 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
Prev Previous commit
Suggested changes
Shubham Vasudeo Desai committed Jan 15, 2025
commit 96dddc69a2bb4e2231e37e8e271733357438597e
7 changes: 3 additions & 4 deletions vector/v.to.rast/do_areas.c
Original file line number Diff line number Diff line change
@@ -94,14 +94,13 @@ int sort_areas(struct Map_info *Map, struct line_pnts *Points, int field,
CELL cat;

G_begin_polygon_area_calculations();
Cats = Vect_new_cats_struct();

/* first count valid areas */
nareas = Vect_get_num_areas(Map);
if (nareas == 0) {
Vect_destroy_cats_struct(Cats);
if (nareas == 0)
return 0;
}

Cats = Vect_new_cats_struct();

/* allocate list to hold valid area info */
list = (struct list *)G_calloc(nareas * sizeof(char), sizeof(struct list));