From 401673318c9efb5115a9594412e0312051987e88 Mon Sep 17 00:00:00 2001 From: kailixu Date: Sat, 24 Aug 2024 14:30:36 +0800 Subject: [PATCH] fix: memory leak of geos --- source/util/src/tgeosctx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/util/src/tgeosctx.c b/source/util/src/tgeosctx.c index 41d9bb9ae3..9248c8cf58 100644 --- a/source/util/src/tgeosctx.c +++ b/source/util/src/tgeosctx.c @@ -68,6 +68,10 @@ int32_t getThreadLocalGeosCtx(SGeosContext **ppCtx) { TAOS_CHECK_EXIT(TAOS_SYSTEM_ERROR(errno)); } + if ((taosThreadSetSpecific(tlGeosCtxKey, &tlGeosCtxObj)) != 0) { + TAOS_CHECK_EXIT(TAOS_SYSTEM_ERROR(errno)); + } + tlGeosCtx = &tlGeosCtxObj; *ppCtx = tlGeosCtx; _exit: