fix invalid free or mem leak
This commit is contained in:
parent
6b25c4756b
commit
ae0aa0b821
|
@ -3134,6 +3134,11 @@ int32_t metaGetColCmpr(SMeta *pMeta, tb_uid_t uid, SHashObj **ppColCmprObj) {
|
|||
int rc = 0;
|
||||
|
||||
SHashObj *pColCmprObj = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_SMALLINT), false, HASH_NO_LOCK);
|
||||
if (pColCmprObj == NULL) {
|
||||
pColCmprObj = NULL;
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
void *pData = NULL;
|
||||
int nData = 0;
|
||||
SMetaEntry e = {0};
|
||||
|
|
|
@ -46,8 +46,11 @@ static int32_t tsdbFSetWriteTableDataBegin(SFSetWriter *writer, const TABLEID *t
|
|||
code = tsdbUpdateSkmTb(writer->config->tsdb, writer->ctx->tbid, writer->skmTb);
|
||||
TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
||||
if (writer->pColCmprObj != NULL) {
|
||||
taosHashCleanup(writer->pColCmprObj);
|
||||
writer->pColCmprObj = NULL;
|
||||
}
|
||||
code = metaGetColCmpr(writer->config->tsdb->pVnode->pMeta, tbid->suid ? tbid->suid : tbid->uid, &writer->pColCmprObj);
|
||||
// TODO: TSDB_CHECK_CODE(code, lino, _exit);
|
||||
|
||||
writer->blockDataIdx = 0;
|
||||
for (int32_t i = 0; i < ARRAY_SIZE(writer->blockData); i++) {
|
||||
|
@ -127,6 +130,8 @@ _exit:
|
|||
TSDB_ERROR_LOG(TD_VID(writer->config->tsdb->pVnode), lino, code);
|
||||
}
|
||||
taosHashCleanup(writer->pColCmprObj);
|
||||
writer->pColCmprObj = NULL;
|
||||
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue