[Groonga-commit] groonga/groonga [master] fix memory leak on loading.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 1月 10日 (月) 10:56:57 JST


Kouhei Sutou	2011-01-10 01:56:57 +0000 (Mon, 10 Jan 2011)

  New Revision: 7db394f3db18d8c5f67334699f83e740eb222c82

  Log:
    fix memory leak on loading.
    
    Reported by Kenichi Aramaki. Thanks!!!

  Modified files:
    lib/db.c

  Modified: lib/db.c (+3 -0)
===================================================================
--- lib/db.c    2011-01-10 01:55:58 +0000 (9573605)
+++ lib/db.c    2011-01-10 01:56:57 +0000 (96b68fd)
@@ -7499,6 +7499,7 @@ set_vector(grn_ctx *ctx, grn_obj *column, grn_id id, grn_obj *vector)
       if (!cast_failed) {
         GRN_UINT32_PUT(ctx, &buf, GRN_RECORD_VALUE(element));
       }
+      if (element == &record) { GRN_OBJ_FIN(ctx, element); }
       v = values_next(ctx, v);
     }
   } else {
@@ -7521,6 +7522,7 @@ set_vector(grn_ctx *ctx, grn_obj *column, grn_id id, grn_obj *vector)
                                    GRN_TEXT_VALUE(element),
                                    GRN_TEXT_LEN(element), 0, GRN_ID_NIL);
           }
+          if (element == &casted_element) { GRN_OBJ_FIN(ctx, element); }
         } else {
           ERR(GRN_ERROR, "bad syntax.");
         }
@@ -7543,6 +7545,7 @@ set_vector(grn_ctx *ctx, grn_obj *column, grn_id id, grn_obj *vector)
         if (!cast_failed) {
           grn_bulk_write(ctx, &buf, GRN_TEXT_VALUE(element), value_size);
         }
+        if (element == &casted_element) { GRN_OBJ_FIN(ctx, element); }
         v = values_next(ctx, v);
       }
     }




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