[Groonga-commit] ranguba/rroonga at 65353da [master] Fix memory leak for drilldown

Back to archive index

Hiroshi Hatake null+****@clear*****
Sat Feb 14 14:19:16 JST 2015


Hiroshi Hatake	2015-02-14 14:19:16 +0900 (Sat, 14 Feb 2015)

  New Revision: 65353da86f85cfcafb4eb52f0c5a66f1142b4b63
  https://github.com/ranguba/rroonga/commit/65353da86f85cfcafb4eb52f0c5a66f1142b4b63

  Message:
    Fix memory leak for drilldown
    
    Previous fix contains consideration leakage of crash.

  Modified files:
    ext/groonga/rb-grn-table.c

  Modified: ext/groonga/rb-grn-table.c (+3 -0)
===================================================================
--- ext/groonga/rb-grn-table.c    2015-02-14 14:10:40 +0900 (3107a23)
+++ ext/groonga/rb-grn-table.c    2015-02-14 14:19:16 +0900 (601065d)
@@ -1462,6 +1462,7 @@ rb_grn_table_group (int argc, VALUE *argv, VALUE self)
             } else if (rb_grn_equal_option(rb_calc_type, "average")) {
                 result.flags |= GRN_TABLE_GROUP_CALC_AVG;
             } else {
+                grn_obj_unlink(context, result.calc_target);
                 rb_raise(rb_eArgError,
                          "invalid calculation type: %s: "
                          "available types: [:max, :min, :sum, :average]",
@@ -1474,6 +1475,8 @@ rb_grn_table_group (int argc, VALUE *argv, VALUE self)
     rb_grn_context_check(context, self);
     rb_grn_rc_check(rc, self);
 
+    grn_obj_unlink(context, result.calc_target);
+
     return GRNOBJECT2RVAL(Qnil, context, result.table, GRN_TRUE);
 }
 
-------------- next part --------------
HTML����������������������������...
Download 



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