Merge pull request #27917 from taosdata/fix/TD-32139/setPointerNullAfterFree

set pointer null after free
This commit is contained in:
Pan Wei 2024-09-18 14:59:57 +08:00 committed by GitHub
commit 8221b2d582
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -547,6 +547,7 @@ void* getBufPage(SDiskbasedBuf* pBuf, int32_t id) {
int32_t code = lruListPushFront(pBuf->lruList, *pi);
if (TSDB_CODE_SUCCESS != code) {
taosMemoryFree((*pi)->pData);
(*pi)->pData = NULL;
terrno = code;
return NULL;
}
@ -557,7 +558,7 @@ void* getBufPage(SDiskbasedBuf* pBuf, int32_t id) {
int32_t code = loadPageFromDisk(pBuf, *pi);
if (code != 0) {
taosMemoryFree((*pi)->pData);
(*pi)->pData = NULL;
terrno = code;
return NULL;
}