From 573d54ae4a43f390334780d060a4191fc006acb2 Mon Sep 17 00:00:00 2001 From: ShubhamDesai <42180509+ShubhamDesai@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:50:42 -0400 Subject: [PATCH] ps.map: Fix Resource Leak issue in ps_vareas.c (#4464) --- ps/ps.map/ps_vareas.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ps/ps.map/ps_vareas.c b/ps/ps.map/ps_vareas.c index 5cd3471a6a8..3968140bd25 100644 --- a/ps/ps.map/ps_vareas.c +++ b/ps/ps.map/ps_vareas.c @@ -65,6 +65,7 @@ static int plot_area(struct Map_info *P_map, int area, double shift) if (0 > (ret = Vect_get_area_points(P_map, area, Points))) { if (ret == -1) G_warning(_("Read error in vector map")); + Vect_destroy_line_struct(Points); return 0; } construct_path(Points, shift, WHOLE_PATH); @@ -76,10 +77,12 @@ static int plot_area(struct Map_info *P_map, int area, double shift) if (0 > (ret = Vect_get_isle_points(P_map, island, Points))) { if (ret == -1) G_warning(_("Read error in vector map")); + Vect_destroy_line_struct(Points); return -1; } construct_path(Points, shift, WHOLE_PATH); } + Vect_destroy_line_struct(Points); return 1; }