fix mem problem

This commit is contained in:
yihaoDeng 2024-08-21 19:52:15 +08:00
parent c35513a507
commit ec3c967fe7
2 changed files with 10 additions and 8 deletions

View File

@ -72,6 +72,7 @@ typedef struct TdFile {
if ((r + 1) <= tsRandErrChance) { \
errno = EIO; \
terrno = TAOS_SYSTEM_ERROR(errno); \
uError("random io error: %s, %s", tstrerror(terrno), __func__); \
return (ret); \
} \
}

View File

@ -308,6 +308,7 @@ void *taosMemoryCalloc(int64_t num, int64_t size) {
uint32_t r = taosRand() % tsRandErrDivisor;
if ((r + 1) <= tsRandErrChance) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
uError("random memory error: %s, %s", tstrerror(terrno), __func__);
return NULL;
}
}