fix: buffer overflow/buffer use after free/memory leak
This commit is contained in:
parent
77eadc59dc
commit
411151d671
|
@ -387,6 +387,8 @@ _exit:
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void tsdbFreeRtnArg(void *arg) { taosMemoryFree(arg); }
|
||||||
|
|
||||||
static int32_t tsdbDoRetentionSync(void *arg) {
|
static int32_t tsdbDoRetentionSync(void *arg) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
int32_t lino = 0;
|
int32_t lino = 0;
|
||||||
|
@ -409,6 +411,7 @@ _exit:
|
||||||
TSDB_ERROR_LOG(TD_VID(rtner->tsdb->pVnode), lino, code);
|
TSDB_ERROR_LOG(TD_VID(rtner->tsdb->pVnode), lino, code);
|
||||||
}
|
}
|
||||||
tsem_post(&((SRtnArg *)arg)->tsdb->pVnode->canCommit);
|
tsem_post(&((SRtnArg *)arg)->tsdb->pVnode->canCommit);
|
||||||
|
tsdbFreeRtnArg(arg);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,7 +441,7 @@ _exit:
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tsdbFreeRtnArg(void *arg) { taosMemoryFree(arg); }
|
|
||||||
|
|
||||||
int32_t tsdbRetention(STsdb *tsdb, int64_t now, int32_t sync) {
|
int32_t tsdbRetention(STsdb *tsdb, int64_t now, int32_t sync) {
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
|
|
|
@ -386,7 +386,6 @@ void destroyStreamFinalIntervalOperatorInfo(void* param) {
|
||||||
SStreamIntervalOperatorInfo* pInfo = (SStreamIntervalOperatorInfo*)param;
|
SStreamIntervalOperatorInfo* pInfo = (SStreamIntervalOperatorInfo*)param;
|
||||||
cleanupBasicInfo(&pInfo->binfo);
|
cleanupBasicInfo(&pInfo->binfo);
|
||||||
cleanupAggSup(&pInfo->aggSup);
|
cleanupAggSup(&pInfo->aggSup);
|
||||||
clearGroupResInfo(&pInfo->groupResInfo);
|
|
||||||
|
|
||||||
// it should be empty.
|
// it should be empty.
|
||||||
void* pIte = NULL;
|
void* pIte = NULL;
|
||||||
|
@ -401,6 +400,7 @@ void destroyStreamFinalIntervalOperatorInfo(void* param) {
|
||||||
blockDataDestroy(pInfo->pDelRes);
|
blockDataDestroy(pInfo->pDelRes);
|
||||||
pInfo->stateStore.streamFileStateDestroy(pInfo->pState->pFileState);
|
pInfo->stateStore.streamFileStateDestroy(pInfo->pState->pFileState);
|
||||||
taosMemoryFreeClear(pInfo->pState);
|
taosMemoryFreeClear(pInfo->pState);
|
||||||
|
clearGroupResInfo(&pInfo->groupResInfo);
|
||||||
|
|
||||||
nodesDestroyNode((SNode*)pInfo->pPhyNode);
|
nodesDestroyNode((SNode*)pInfo->pPhyNode);
|
||||||
colDataDestroy(&pInfo->twAggSup.timeWindowData);
|
colDataDestroy(&pInfo->twAggSup.timeWindowData);
|
||||||
|
|
|
@ -185,7 +185,7 @@ SStreamMeta* streamMetaOpen(const char* path, void* ahandle, FTaskExpand expandF
|
||||||
taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK);
|
taosHashInit(64, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK);
|
||||||
pMeta->chkpSaved = taosArrayInit(4, sizeof(int64_t));
|
pMeta->chkpSaved = taosArrayInit(4, sizeof(int64_t));
|
||||||
pMeta->chkpInUse = taosArrayInit(4, sizeof(int64_t));
|
pMeta->chkpInUse = taosArrayInit(4, sizeof(int64_t));
|
||||||
pMeta->chkpCap = 8;
|
pMeta->chkpCap = 2;
|
||||||
taosInitRWLatch(&pMeta->chkpDirLock);
|
taosInitRWLatch(&pMeta->chkpDirLock);
|
||||||
|
|
||||||
pMeta->chkpId = streamGetLatestCheckpointId(pMeta);
|
pMeta->chkpId = streamGetLatestCheckpointId(pMeta);
|
||||||
|
|
|
@ -194,7 +194,7 @@ int32_t streamSnapHandleInit(SStreamSnapHandle* pHandle, char* path, int64_t chk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
char* buf = taosMemoryCalloc(1, 512);
|
char* buf = taosMemoryCalloc(1, 1024);
|
||||||
sprintf(buf, "[current: %s,", pFile->pCurrent);
|
sprintf(buf, "[current: %s,", pFile->pCurrent);
|
||||||
sprintf(buf + strlen(buf), "MANIFEST: %s,", pFile->pMainfest);
|
sprintf(buf + strlen(buf), "MANIFEST: %s,", pFile->pMainfest);
|
||||||
sprintf(buf + strlen(buf), "options: %s,", pFile->pOptions);
|
sprintf(buf + strlen(buf), "options: %s,", pFile->pOptions);
|
||||||
|
|
Loading…
Reference in New Issue