From 8541dace7ded2ba7f3484ddb60f8acb24338f09f Mon Sep 17 00:00:00 2001 From: Edouard Charvet Date: Mon, 11 Apr 2022 08:53:26 +0200 Subject: [PATCH] add API function to free memory dynamically allocated by function ZDHelperSimpleLookupString --- library/zonedetect.c | 5 +++++ library/zonedetect.h | 1 + 2 files changed, 6 insertions(+) diff --git a/library/zonedetect.c b/library/zonedetect.c index 9265c62..2f92ea6 100644 --- a/library/zonedetect.c +++ b/library/zonedetect.c @@ -1249,3 +1249,8 @@ done: ZDFreeResults(result); return output; } + +void ZDHelperSimpleLookupStringFree(char* str) +{ + free(str); +} \ No newline at end of file diff --git a/library/zonedetect.h b/library/zonedetect.h index 710cb5a..4948ac2 100644 --- a/library/zonedetect.h +++ b/library/zonedetect.h @@ -83,6 +83,7 @@ ZD_EXPORT const char *ZDGetErrorString(int errZD); ZD_EXPORT float* ZDPolygonToList(const ZoneDetect *library, uint32_t polygonId, size_t* length); ZD_EXPORT char* ZDHelperSimpleLookupString(const ZoneDetect* library, float lat, float lon); +ZD_EXPORT void ZDHelperSimpleLookupStringFree(char* str); #ifdef __cplusplus }