!96 fix free problem

Merge pull request !96 from shipixian/dev_performance
This commit is contained in:
zoujia_yewu 2023-03-29 02:15:45 +00:00 committed by Gitee
commit 693ab1c6b0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 4 additions and 4 deletions

View File

@ -1231,7 +1231,7 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum,
free(pageXlogPtr);
pageXlogPtr = NULL;
} else if (tWalRecord.count != 0) {
free_dataRead(tWalRecord.buf,tWalRecord.count,tWalRecord.cap);
free_dataRead(tWalRecord.buf,1,1);
FreeLsnNode(head);
} else {
if (walRecord.buf != NULL) {

View File

@ -772,7 +772,7 @@ he3db_mdread_pagexlog(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknu
nbytes = bufrd.count;
*buffer = (uint8_t *)malloc(bufrd.count);
memcpy(*buffer, bufrd.buf,bufrd.count);
free_dataRead(bufrd.buf, bufrd.count, bufrd.cap);
free_dataRead(bufrd.buf, 1,1);
if (push_standby)
{
Assert(bufrd.count == BLCKSZ);
@ -789,7 +789,7 @@ he3db_mdread_pagexlog(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknu
nbytes += result.count;
*buffer = (uint8_t *)realloc(*buffer, BLCKSZ + result.count);
strcat(*buffer,result.buf);
free_dataRead(result.buf, result.count, result.cap);
free_dataRead(result.buf, 1,1);
}
//TODO free result
FreeLsnNode(head);
@ -845,7 +845,7 @@ he3db_mdread_pagexlog(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknu
buf = (uint8_t *)realloc(buf, BLCKSZ + result.count);
strcat(buf,result.buf);
//TODO free result
free_dataRead(result.buf, result.count, result.cap);
free_dataRead(result.buf, 1,1);
}
*buffer = buf;
FreeLsnNode(head);