set pointer null after free

This commit is contained in:
xsren 2024-09-18 11:19:45 +08:00
parent 4c459155f1
commit bc96802a10
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;
}