[Groonga-commit] groonga/groonga [master] guard grn_obj_unlink with obj->header.type

Back to archive index

null+****@clear***** null+****@clear*****
2010年 7月 22日 (木) 11:12:45 JST


Nobuyoshi Nakada	2010-07-22 02:12:45 +0000 (Thu, 22 Jul 2010)

  New Revision: fde14b63d67ce6deed80a317de578b9d55c97c80

  Log:
    guard grn_obj_unlink with obj->header.type

  Modified files:
    lib/expr.c

  Modified: lib/expr.c (+5 -1)
===================================================================
--- lib/expr.c    2010-07-22 07:24:04 +0000 (5a36889)
+++ lib/expr.c    2010-07-22 02:12:45 +0000 (6092b4c)
@@ -615,7 +615,11 @@ grn_expr_close(grn_ctx *ctx, grn_obj *expr)
     grn_obj *obj;
     GRN_PTR_POP(&e->objs, obj);
     if (obj) {
-      grn_obj_unlink(ctx, obj);
+      if (obj->header.type) {
+        grn_obj_unlink(ctx, obj);
+      } else {
+        GRN_LOG(ctx, GRN_LOG_WARNING, "GRN_VOID object is tried to be unlinked");
+      }
     } else { break; }
   }
   grn_obj_close(ctx, &e->objs);




Groonga-commit メーリングリストの案内
Back to archive index