8000 Fix a memory leak bug in function `polygonStringToGeoPolygon` by mugitya03 · Pull Request #976 · uber/h3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix a memory leak bug in function polygonStringToGeoPolygon #976

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

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

mugitya03
Copy link
Contributor

The pointer verts at line 14 of function polygonStringToGeoPolygon is not freed before the function returns at line 34. Thus there is a memory leak bug.

LatLng *verts = calloc(numVerts, sizeof(LatLng));

            if (curDepth > 4) {
                // This is beyond the depth for a valid input, so we abort early
                return E_FAILED;
            }

The pointer `verts` at line 14 is not freed before the function returns at line 34. Thus there is a memory leak bug.

`LatLng *verts = calloc(numVerts, sizeof(LatLng));`

```
            if (curDepth > 4) {
                // This is beyond the depth for a valid input, so we abort early
                return E_FAILED;
            }
```
@CLAassistant
Copy link
CLAassistant commented Feb 26, 2025

CLA assistant check
All committers have signed the CLA.

@coveralls
Copy link

Coverage Status

coverage: 98.784%. remained the same
when pulling 12f9d27 on mugitya03:master
into 3a02395 on uber:master.

@isaacbrodsky isaacbrodsky merged commit 2f689a3 into uber:master Feb 27, 2025
40 checks passed
ajfriend pushed a commit to ajfriend/h3 that referenced this pull request Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0