mirror of
https://gitee.com/he3db/he3pg.git
synced 2024-12-02 04:07:34 +08:00
fix free problem
Signed-off-by: shipixian <shipixian_yewu@cmss.chinamobile.com>
This commit is contained in:
parent
f326eba527
commit
87f185d1af
@ -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,1,1);
|
||||
free_dataRead(tWalRecord.buf,tWalRecord.count,tWalRecord.cap);
|
||||
FreeLsnNode(head);
|
||||
} else {
|
||||
if (walRecord.buf != NULL) {
|
||||
|
@ -2437,7 +2437,7 @@ MasterFileRead(char *buffer,uint32_t dbid, uint32_t relid, uint32_t forkno, uint
|
||||
if (bufrd.count > 0)
|
||||
{
|
||||
memcpy(buffer,bufrd.buf,bufrd.count);
|
||||
free_dataRead(bufrd.buf,1,1);
|
||||
free_dataRead(bufrd.buf,bufrd.count, bufrd.cap);
|
||||
}
|
||||
|
||||
return bufrd.count;
|
||||
|
@ -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, 1,1);
|
||||
free_dataRead(bufrd.buf, bufrd.count, bufrd.cap);
|
||||
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, 1,1);
|
||||
free_dataRead(result.buf, result.count, result.cap);
|
||||
}
|
||||
//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, 1,1);
|
||||
free_dataRead(result.buf, result.count, result.cap);
|
||||
}
|
||||
*buffer = buf;
|
||||
FreeLsnNode(head);
|
||||
|
Loading…
Reference in New Issue
Block a user