Fix ci problems.

This commit is contained in:
xiao-77 2024-12-12 19:31:28 +08:00
parent d6078fd0b7
commit f8a6489bb8
2 changed files with 15 additions and 7 deletions

View File

@ -63,9 +63,10 @@ int32_t mndInitConfig(SMnode *pMnode) {
} }
SSdbRaw *mnCfgActionEncode(SConfigObj *obj) { SSdbRaw *mnCfgActionEncode(SConfigObj *obj) {
int32_t code = 0; int32_t code = 0;
int32_t lino = 0; int32_t lino = 0;
void *buf = NULL; void *buf = NULL;
SSdbRaw *pRaw = NULL;
SEncoder encoder; SEncoder encoder;
tEncoderInit(&encoder, NULL, 0); tEncoderInit(&encoder, NULL, 0);
@ -77,8 +78,8 @@ SSdbRaw *mnCfgActionEncode(SConfigObj *obj) {
int32_t tlen = encoder.pos; int32_t tlen = encoder.pos;
tEncoderClear(&encoder); tEncoderClear(&encoder);
int32_t size = sizeof(int32_t) + tlen + CFG_RESERVE_SIZE; int32_t size = sizeof(int32_t) + tlen;
SSdbRaw *pRaw = sdbAllocRaw(SDB_CFG, CFG_VER_NUMBER, size); pRaw = sdbAllocRaw(SDB_CFG, CFG_VER_NUMBER, size);
TSDB_CHECK_NULL(pRaw, code, lino, _over, terrno); TSDB_CHECK_NULL(pRaw, code, lino, _over, terrno);
buf = taosMemoryMalloc(tlen); buf = taosMemoryMalloc(tlen);
@ -173,6 +174,7 @@ static int32_t mndCfgActionInsert(SSdb *pSdb, SConfigObj *obj) {
static int32_t mndCfgActionDelete(SSdb *pSdb, SConfigObj *obj) { static int32_t mndCfgActionDelete(SSdb *pSdb, SConfigObj *obj) {
mTrace("cfg:%s, perform delete action, row:%p", obj->name, obj); mTrace("cfg:%s, perform delete action, row:%p", obj->name, obj);
tFreeSConfigObj(obj);
return 0; return 0;
} }
@ -306,9 +308,11 @@ int32_t mndInitWriteCfg(SMnode *pMnode) {
if ((code = mndSetCreateConfigCommitLogs(pTrans, versionObj)) != 0) { if ((code = mndSetCreateConfigCommitLogs(pTrans, versionObj)) != 0) {
mError("failed to init mnd config version, since %s", tstrerror(code)); mError("failed to init mnd config version, since %s", tstrerror(code));
tFreeSConfigObj(versionObj); tFreeSConfigObj(versionObj);
taosMemoryFree(versionObj);
goto _OVER; goto _OVER;
} }
tFreeSConfigObj(versionObj); tFreeSConfigObj(versionObj);
taosMemoryFree(versionObj);
sz = taosArrayGetSize(taosGetGlobalCfg(tsCfg)); sz = taosArrayGetSize(taosGetGlobalCfg(tsCfg));
for (int i = 0; i < sz; ++i) { for (int i = 0; i < sz; ++i) {
@ -321,9 +325,11 @@ int32_t mndInitWriteCfg(SMnode *pMnode) {
if ((code = mndSetCreateConfigCommitLogs(pTrans, obj)) != 0) { if ((code = mndSetCreateConfigCommitLogs(pTrans, obj)) != 0) {
mError("failed to init mnd config:%s, since %s", item->name, tstrerror(code)); mError("failed to init mnd config:%s, since %s", item->name, tstrerror(code));
tFreeSConfigObj(obj); tFreeSConfigObj(obj);
taosMemoryFree(obj);
goto _OVER; goto _OVER;
} }
tFreeSConfigObj(obj); tFreeSConfigObj(obj);
taosMemoryFree(obj);
} }
if ((code = mndTransPrepare(pMnode, pTrans)) != 0) goto _OVER; if ((code = mndTransPrepare(pMnode, pTrans)) != 0) goto _OVER;
@ -657,7 +663,9 @@ _OVER:
} }
mndTransDrop(pTrans); mndTransDrop(pTrans);
tFreeSConfigObj(pVersion); tFreeSConfigObj(pVersion);
taosMemoryFree(pVersion);
tFreeSConfigObj(pObj); tFreeSConfigObj(pObj);
taosMemoryFree(pObj);
return code; return code;
} }
@ -759,6 +767,7 @@ static void cfgObjArrayCleanUp(SArray *array) {
for (int32_t i = 0; i < sz; ++i) { for (int32_t i = 0; i < sz; ++i) {
SConfigObj *obj = taosArrayGet(array, i); SConfigObj *obj = taosArrayGet(array, i);
tFreeSConfigObj(obj); tFreeSConfigObj(obj);
taosMemoryFree(obj);
} }
taosArrayDestroy(array); taosArrayDestroy(array);
} }

View File

@ -908,9 +908,8 @@ void tFreeSConfigObj(SConfigObj *obj) {
} }
if (obj->dtype == CFG_DTYPE_STRING || obj->dtype == CFG_DTYPE_DIR || obj->dtype == CFG_DTYPE_LOCALE || if (obj->dtype == CFG_DTYPE_STRING || obj->dtype == CFG_DTYPE_DIR || obj->dtype == CFG_DTYPE_LOCALE ||
obj->dtype == CFG_DTYPE_CHARSET || obj->dtype == CFG_DTYPE_TIMEZONE) { obj->dtype == CFG_DTYPE_CHARSET || obj->dtype == CFG_DTYPE_TIMEZONE) {
taosMemoryFreeClear(obj->str); taosMemoryFree(obj->str);
} }
taosMemoryFreeClear(obj);
} }
// SMqSubActionLogEntry *tCloneSMqSubActionLogEntry(SMqSubActionLogEntry *pEntry) { // SMqSubActionLogEntry *tCloneSMqSubActionLogEntry(SMqSubActionLogEntry *pEntry) {