fix: memleak in taosSplitS3Cfg
This commit is contained in:
parent
1e83be102d
commit
21f8d6b7c1
|
@ -955,7 +955,11 @@ static int32_t s3InitEpIndexArray(SArray **pIndexArray) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int8_t i = 0; i < tsS3EpNum; ++i) {
|
for (int8_t i = 0; i < tsS3EpNum; ++i) {
|
||||||
taosArraySet(indexArray, i, &i);
|
if (taosArrayPush(indexArray, &i) == NULL) {
|
||||||
|
taosArrayDestroy(indexArray);
|
||||||
|
uError("%s: %s", __func__, "out of memory");
|
||||||
|
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tsS3EpNum > 1) {
|
if (tsS3EpNum > 1) {
|
||||||
|
|
|
@ -376,6 +376,7 @@ static int32_t taosSplitS3Cfg(SConfig *pCfg, const char *name, char gVarible[TSD
|
||||||
*pNum = num;
|
*pNum = num;
|
||||||
|
|
||||||
_exit:
|
_exit:
|
||||||
|
taosMemoryFreeClear(slices);
|
||||||
taosMemoryFreeClear(strDup);
|
taosMemoryFreeClear(strDup);
|
||||||
TAOS_RETURN(code);
|
TAOS_RETURN(code);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue