Merge pull request #28135 from taosdata/fix/TD-32320

fix mem leak
This commit is contained in:
Hongze Cheng 2024-09-27 09:07:13 +08:00 committed by GitHub
commit f617d216f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 4 deletions

View File

@ -734,7 +734,7 @@ void flushSnapshot(SStreamFileState* pFileState, SStreamSnapshot* pSnapshot, boo
// todo handle failure
memset(buf, 0, len);
}
taosMemoryFree(buf);
taosMemoryFreeClear(buf);
int32_t numOfElems = streamStateGetBatchSize(batch);
if (numOfElems > 0) {
@ -769,6 +769,7 @@ _end:
if (code != TSDB_CODE_SUCCESS) {
qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
}
taosMemoryFree(buf);
streamStateDestroyBatch(batch);
}