diff --git a/source/dnode/vnode/src/meta/metaTable.c b/source/dnode/vnode/src/meta/metaTable.c index 45a6265da06c41a21d3b28b9ff75fb999deac062..d16c5b19f3b241e1247391d0db52a3efad9b3a1b 100644 --- a/source/dnode/vnode/src/meta/metaTable.c +++ b/source/dnode/vnode/src/meta/metaTable.c @@ -575,7 +575,11 @@ static int metaDropTableByUid(SMeta *pMeta, tb_uid_t uid, int *type) { tdbTbGet(pMeta->pTbDb, &(STbDbKey){.version = version, .uid = uid}, sizeof(STbDbKey), &pData, &nData); tDecoderInit(&dc, pData, nData); - metaDecodeEntry(&dc, &e); + rc = metaDecodeEntry(&dc, &e); + if (rc < 0) { + tDecoderClear(&dc); + return -1; + } if (type) *type = e.type; @@ -1249,7 +1253,10 @@ static int metaUpdateTagIdx(SMeta *pMeta, const SMetaEntry *pCtbEntry) { tdbTbGet(pMeta->pTbDb, &tbDbKey, sizeof(tbDbKey), &pData, &nData); tDecoderInit(&dc, pData, nData); - metaDecodeEntry(&dc, &stbEntry); + ret = metaDecodeEntry(&dc, &stbEntry); + if (ret < 0) { + goto end; + } pTagColumn = &stbEntry.stbEntry.schemaTag.pSchema[0]; diff --git a/source/libs/tdb/src/db/tdbTable.c b/source/libs/tdb/src/db/tdbTable.c index 73cc34a86fb3f22d467064c2386a1768c872ca6a..8b029b06d6d6b0c0332b48bb36075fc9e3fbf28d 100644 --- a/source/libs/tdb/src/db/tdbTable.c +++ b/source/libs/tdb/src/db/tdbTable.c @@ -53,6 +53,7 @@ int tdbTbOpen(const char *tbname, int keyLen, int valLen, tdb_cmpr_fn_t keyCmprF if (strcmp(TDB_MAINDB_NAME, tbname)) { pPager = tdbEnvGetPager(pEnv, fFullName); if (!pPager) { + tdbOsFree(pTb); return -1; } @@ -72,6 +73,7 @@ int tdbTbOpen(const char *tbname, int keyLen, int valLen, tdb_cmpr_fn_t keyCmprF if (pPager == NULL) { ret = tdbPagerOpen(pEnv->pCache, fFullName, &pPager); if (ret < 0) { + tdbOsFree(pTb); return -1; } @@ -94,6 +96,7 @@ int tdbTbOpen(const char *tbname, int keyLen, int valLen, tdb_cmpr_fn_t keyCmprF snprintf(fFullName, TDB_FILENAME_LEN, "%s/%s", pEnv->dbName, tbname); ret = tdbPagerOpen(pEnv->pCache, fFullName, &pPager); if (ret < 0) { + tdbOsFree(pTb); return -1; }