Merge pull request #11600 from taosdata/fix/ZhiqiangWang/TD-13756-getline-memory-free-error

fix(os): getline memory free error.
This commit is contained in:
Zhiqiang Wang 2022-04-18 17:52:12 +08:00 committed by GitHub
commit c1d5d3cdbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -772,6 +772,9 @@ int64_t taosGetLineFile(TdFilePtr pFile, char **__restrict ptrBuf) {
if (pFile == NULL) {
return -1;
}
if (*ptrBuf != NULL) {
taosMemoryFreeClear(*ptrBuf);
}
assert(pFile->fp != NULL);
size_t len = 0;