Skip to content

Commit

Permalink
r.watershed: Fix Resource Leak issue (#4687)
Browse files Browse the repository at this point in the history
* Fix Resource Leak issue

* G_free()
  • Loading branch information
ShubhamDesai authored Nov 23, 2024
1 parent a58e178 commit 29bb77b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions raster/r.watershed/ram/do_cum.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ int do_cum(void)
}
}
G_free(astar_pts);
G_free(contour);
G_free(dist_to_nbr);

return 0;
}
Expand Down Expand Up @@ -632,6 +634,7 @@ int do_cum_mfd(void)

G_free(dist_to_nbr);
G_free(weight);
G_free(contour);

return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions raster/r.watershed/seg/do_cum.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ int do_cum(void)
G_percent(do_points, do_points, 1); /* finish it */

seg_close(&astar_pts);
G_free(dist_to_nbr);
G_free(contour);

return 0;
}
Expand Down

0 comments on commit 29bb77b

Please sign in to comment.