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

r.watershed: Fix Resource Leak issue in close_maps.c #4607

Merged
merged 2 commits into from
Oct 28, 2024

Conversation

ShubhamDesai
Copy link
Contributor

This pull request fixes resource leak issue identified by Coverity Scan (CID : 1207607)
Changes Made

  • Freed afbuf in the asp_flag block: Added G_free(afbuf); after Rast_close(fd); to ensure afbuf is released after its final usage.
  • in addition to afbuf; cbuf (allocated using Rast_allocate_c_buf()) is also freed to prevent memory leaks.

@github-actions github-actions bot added raster Related to raster data processing C Related code is in C module labels Oct 27, 2024
@nilason nilason added this to the 8.5.0 milestone Oct 27, 2024
@nilason nilason merged commit 7d101ed into OSGeo:main Oct 28, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C module raster Related to raster data processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants