[Groonga-commit] groonga/groonga at 1be9b23 [master] Fix a memory leak on error while updating index for var size column vector

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Nov 1 12:32:15 JST 2013


Kouhei Sutou	2013-11-01 12:32:15 +0900 (Fri, 01 Nov 2013)

  New Revision: 1be9b23c04240a01e16330ab4976da8a21809a36
  https://github.com/groonga/groonga/commit/1be9b23c04240a01e16330ab4976da8a21809a36

  Message:
    Fix a memory leak on error while updating index for var size column vector
    
    If a column value has invalid UTF-8 byte, the error will be
    caused. But we can't write a test for the case because grntest detect
    invalid UTF-8 and report an error before passing JSON to Groonga.

  Modified files:
    lib/db.c

  Modified: lib/db.c (+2 -2)
===================================================================
--- lib/db.c    2013-11-01 12:09:38 +0900 (f8c999b)
+++ lib/db.c    2013-11-01 12:32:15 +0900 (9b162f3)
@@ -5239,7 +5239,7 @@ call_hook(grn_ctx *ctx, grn_obj *obj, grn_id id, grn_obj *value, int flags)
           default_set_value_hook(ctx, 1, &obj, &pctx.user_data);
         }
         if (ctx->rc) {
-          grn_bulk_fin(ctx, oldvalue);
+          grn_obj_close(ctx, oldvalue);
           return 1;
         }
         hooks = hooks->next;
@@ -5281,7 +5281,7 @@ call_hook_for_build(grn_ctx *ctx, grn_obj *obj, grn_id id, grn_obj *value, int f
           default_set_value_hook(ctx, 1, &obj, &pctx.user_data);
         }
         if (ctx->rc) {
-          grn_bulk_fin(ctx, &oldvalue);
+          grn_obj_close(ctx, &oldvalue);
           return 1;
         }
         hooks = hooks->next;
-------------- next part --------------
HTML����������������������������...
Download 



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