fix: memory leak of geos

This commit is contained in:
kailixu 2024-08-20 10:18:14 +08:00
parent 66878fd040
commit 5e77f6f6ca
1 changed files with 2 additions and 4 deletions

View File

@ -43,15 +43,13 @@ SGeosContext *getThreadLocalGeosCtx() {
}
if (!sGeosPool.poolArray) {
if (!(sGeosPool.poolArray = taosArrayInit(16, POINTER_BYTES))) {
taosMemoryFree(sGeosPool.pool);
sGeosPool.pool = NULL;
taosMemoryFreeClear(sGeosPool.pool);
taosWUnLockLatch(&sGeosPool.lock);
return NULL;
}
}
if (!taosArrayPush(sGeosPool.poolArray, &sGeosPool.pool)) {
taosMemoryFree(sGeosPool.pool);
sGeosPool.pool = NULL;
taosMemoryFreeClear(sGeosPool.pool);
taosWUnLockLatch(&sGeosPool.lock);
return NULL;
}