Navigation Menu

Skip to content

Commit

Permalink
Fix possible reusing uncleared segments
Browse files Browse the repository at this point in the history
  • Loading branch information
daijiro committed Aug 12, 2012
1 parent 5dfb424 commit 444e3f0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/store.c
Expand Up @@ -579,9 +579,14 @@ grn_ja_replace(grn_ctx *ctx, grn_ja *ja, grn_id id,
}
}
SEGMENTS_EINFO_ON(ja, i, lseg);
*pseg = i;
GRN_IO_SEG_REF(ja->io, i, einfo);
if (einfo) {
*pseg = i;
memset(einfo, 0, JA_SEGMENT_SIZE);
}
} else {
GRN_IO_SEG_REF(ja->io, *pseg, einfo);
}
GRN_IO_SEG_REF(ja->io, *pseg, einfo);
if (!einfo) {
rc = GRN_NO_MEMORY_AVAILABLE;
goto exit;
Expand Down

0 comments on commit 444e3f0

Please sign in to comment.