fix latch/pin leak
git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@990 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe
This commit is contained in:
parent
a5cc4e5b53
commit
ff309a6fbf
1 changed files with 5 additions and 1 deletions
|
@ -340,7 +340,11 @@ TUPLE* DataPage<TUPLE>::iterator::getnext()
|
||||||
Page * p = loadPage(dp->xid_, dp->calc_chunk_from_offset(read_offset_).page);
|
Page * p = loadPage(dp->xid_, dp->calc_chunk_from_offset(read_offset_).page);
|
||||||
readlock(p->rwlatch, 0);
|
readlock(p->rwlatch, 0);
|
||||||
succ = dp->read_data((byte*)&len, read_offset_, sizeof(len));
|
succ = dp->read_data((byte*)&len, read_offset_, sizeof(len));
|
||||||
if((!succ) || (len == 0)) { return NULL; }
|
if((!succ) || (len == 0)) {
|
||||||
|
unlock(p->rwlatch);
|
||||||
|
releasePage(p);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
read_offset_ += sizeof(len);
|
read_offset_ += sizeof(len);
|
||||||
|
|
||||||
byte * buf = (byte*)malloc(len);
|
byte * buf = (byte*)malloc(len);
|
||||||
|
|
Loading…
Reference in a new issue