fix: memory leak of geos
This commit is contained in:
parent
66878fd040
commit
5e77f6f6ca
|
@ -43,15 +43,13 @@ SGeosContext *getThreadLocalGeosCtx() {
|
||||||
}
|
}
|
||||||
if (!sGeosPool.poolArray) {
|
if (!sGeosPool.poolArray) {
|
||||||
if (!(sGeosPool.poolArray = taosArrayInit(16, POINTER_BYTES))) {
|
if (!(sGeosPool.poolArray = taosArrayInit(16, POINTER_BYTES))) {
|
||||||
taosMemoryFree(sGeosPool.pool);
|
taosMemoryFreeClear(sGeosPool.pool);
|
||||||
sGeosPool.pool = NULL;
|
|
||||||
taosWUnLockLatch(&sGeosPool.lock);
|
taosWUnLockLatch(&sGeosPool.lock);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!taosArrayPush(sGeosPool.poolArray, &sGeosPool.pool)) {
|
if (!taosArrayPush(sGeosPool.poolArray, &sGeosPool.pool)) {
|
||||||
taosMemoryFree(sGeosPool.pool);
|
taosMemoryFreeClear(sGeosPool.pool);
|
||||||
sGeosPool.pool = NULL;
|
|
||||||
taosWUnLockLatch(&sGeosPool.lock);
|
taosWUnLockLatch(&sGeosPool.lock);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue