fix lsm iterator data corruption bug
This commit is contained in:
parent
fe6c865737
commit
e22c35a1b5
1 changed files with 3 additions and 2 deletions
|
@ -906,8 +906,9 @@ int lsmTreeIterator_next(int xid, lladdIterator_t *it) {
|
|||
impl->current.size = keySize;
|
||||
}
|
||||
if(impl->current.size != INVALID_SLOT) {
|
||||
impl->t = malloc(sizeof(*impl->t));
|
||||
*impl->t = *readNodeRecord(xid,impl->p,impl->current.slot,impl->current.size);
|
||||
size_t sz = sizeof(*impl->t) + impl->current.size;
|
||||
impl->t = malloc(sz);
|
||||
memcpy(impl->t, readNodeRecord(xid,impl->p,impl->current.slot,impl->current.size), sz);
|
||||
return 1;
|
||||
} else {
|
||||
free(impl->t);
|
||||
|
|
Loading…
Reference in a new issue