[Groonga-commit] groonga/groonga at 04403f1 [master] ii: add missing type check

Back to archive index
Kouhei Sutou null+****@clear*****
Fri Jan 25 18:47:37 JST 2019


Kouhei Sutou	2019-01-25 18:47:37 +0900 (Fri, 25 Jan 2019)

  Revision: 04403f1d22c99560bc89544c3f7dfe9240be3920
  https://github.com/groonga/groonga/commit/04403f1d22c99560bc89544c3f7dfe9240be3920

  Message:
    ii: add missing type check

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+2 -2)
===================================================================
--- lib/ii.c    2019-01-25 16:17:35 +0900 (56774e957)
+++ lib/ii.c    2019-01-25 18:47:37 +0900 (85ea97c9e)
@@ -7456,14 +7456,14 @@ grn_ii_column_update(grn_ctx *ctx, grn_ii *ii, grn_id rid, unsigned int section,
   }
 exit :
   grn_io_unlock(ii->seg);
-  if (old) {
+  if (old && old->header.type == GRN_TABLE_HASH_KEY) {
     grn_hash *o = (grn_hash *)old;
     GRN_HASH_EACH(ctx, o, id, &tp, NULL, &u, {
       grn_ii_updspec_close(ctx, *u);
     });
     if (old != oldvalue) { grn_obj_close(ctx, old); }
   }
-  if (new) {
+  if (new && new->header.type == GRN_TABLE_HASH_KEY) {
     grn_hash *n = (grn_hash *)new;
     GRN_HASH_EACH(ctx, n, id, &tp, NULL, &u, {
       grn_ii_updspec_close(ctx, *u);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190125/e8660041/attachment-0001.html>


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