Fix memory leak in issue #46

Fix memory leak found in
https://github.com/BertoldVdb/ZoneDetect/issues/46.
Free memory which is not used nor freed nor returned
from a function.
This commit is contained in:
Albert Kharisov 2025-12-16 18:52:30 +04:00 committed by GitHub
parent 082fa6b148
commit 1dc78b572d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -618,6 +618,7 @@ float* ZDPolygonToList(const ZoneDetect *library, uint32_t polygonId, size_t* le
flData[i] = ZDFixedPointToFloat(lat, 90, library->precision);
flData[i+1] = ZDFixedPointToFloat(lon, 180, library->precision);
}
free(data);
if(lengthPtr) {
*lengthPtr = length;
@ -1257,4 +1258,4 @@ done:
void ZDHelperSimpleLookupStringFree(char* str)
{
free(str);
}
}