Skip to content

Fix a memory leak bug in function polygonStringToGeoPolygon - #976

Merged
isaacbrodsky merged 1 commit into
uber:masterfrom
mugitya03:master
Feb 27, 2025
Merged

isaacbrodsky merged 1 commit into
uber:masterfrom
mugitya03:master

Conversation

@mugitya03

Copy link
Copy Markdown
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

CLAassistant commented Feb 26, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coveralls

Copy link
Copy Markdown

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
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