From 3c7ec707b2ba23e15f587fecc4882f78f0655359 Mon Sep 17 00:00:00 2001 From: kailixu Date: Sat, 24 Aug 2024 10:36:19 +0800 Subject: [PATCH] fix: memory leak of geos --- source/util/src/tgeosctx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/util/src/tgeosctx.c b/source/util/src/tgeosctx.c index e8015f691a..76a81aa901 100644 --- a/source/util/src/tgeosctx.c +++ b/source/util/src/tgeosctx.c @@ -82,4 +82,6 @@ _exit: TAOS_RETURN(code); } -const char *getGeosErrMsg(int32_t code) { return tlGeosCtx ? tlGeosCtx->errMsg : code ? strerror(code) : ""; } \ No newline at end of file +const char *getGeosErrMsg(int32_t code) { + return (tlGeosCtx && tlGeosCtx->errMsg[0] != 0) ? tlGeosCtx->errMsg : (code ? tstrerror(code) : ""); +} \ No newline at end of file