set pointer null after free
This commit is contained in:
parent
4c459155f1
commit
bc96802a10
|
@ -547,6 +547,7 @@ void* getBufPage(SDiskbasedBuf* pBuf, int32_t id) {
|
||||||
int32_t code = lruListPushFront(pBuf->lruList, *pi);
|
int32_t code = lruListPushFront(pBuf->lruList, *pi);
|
||||||
if (TSDB_CODE_SUCCESS != code) {
|
if (TSDB_CODE_SUCCESS != code) {
|
||||||
taosMemoryFree((*pi)->pData);
|
taosMemoryFree((*pi)->pData);
|
||||||
|
(*pi)->pData = NULL;
|
||||||
terrno = code;
|
terrno = code;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -557,7 +558,7 @@ void* getBufPage(SDiskbasedBuf* pBuf, int32_t id) {
|
||||||
int32_t code = loadPageFromDisk(pBuf, *pi);
|
int32_t code = loadPageFromDisk(pBuf, *pi);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
taosMemoryFree((*pi)->pData);
|
taosMemoryFree((*pi)->pData);
|
||||||
|
(*pi)->pData = NULL;
|
||||||
terrno = code;
|
terrno = code;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue