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

i.pca: Fix Resource Leak issue #4664

Merged
merged 5 commits into from
Dec 2, 2024
Merged

i.pca: Fix Resource Leak issue #4664

merged 5 commits into from
Dec 2, 2024

Conversation

ShubhamDesai
Copy link
Contributor

@ShubhamDesai ShubhamDesai commented Nov 6, 2024

This pull request fixes issue identified by coverity scan (CID : 1207830, 1207835, 1207833, 1207834, 1207836, 1207837)
G_free() is used.

@github-actions github-actions bot added C Related code is in C module imagery labels Nov 6, 2024
Copy link
Contributor

@nilason nilason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not misreading the code, sum2 and rowbuf are both 2D arrays, of which each part also needs to be freed.

This will lead to too much repetitive code for freeing resources, so I'd suggest we use goto with a return value variable.

@nilason nilason added this to the 8.5.0 milestone Nov 7, 2024
Shubham Vasudeo Desai added 2 commits November 8, 2024 17:30
@ShubhamDesai
Copy link
Contributor Author

If I'm not misreading the code, sum2 and rowbuf are both 2D arrays, of which each part also needs to be freed.

This will lead to too much repetitive code for freeing resources, so I'd suggest we use goto with a return value variable.

Done

imagery/i.pca/main.c Outdated Show resolved Hide resolved
@nilason nilason merged commit 43b9d8d into OSGeo:main Dec 2, 2024
23 of 24 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 imagery module
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants