[Groonga-commit] groonga/groonga [master] Fix possible reusing uncleared segments

Back to archive index

Daijiro MORI null+****@clear*****
Sun Aug 12 20:59:02 JST 2012


Daijiro MORI	2012-08-12 20:59:02 +0900 (Sun, 12 Aug 2012)

  New Revision: 444e3f0e319bf79566268902b18e593cd036d0c8
  https://github.com/groonga/groonga/commit/444e3f0e319bf79566268902b18e593cd036d0c8

  Log:
    Fix possible reusing uncleared segments

  Modified files:
    lib/store.c

  Modified: lib/store.c (+7 -2)
===================================================================
--- lib/store.c    2012-08-12 20:57:30 +0900 (7eb8752)
+++ lib/store.c    2012-08-12 20:59:02 +0900 (fe4e67e)
@@ -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;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index