[Groonga-commit] groonga/groonga at 02d8a47 [master] Fix a memory leak

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Sep 11 11:56:46 JST 2018


Kouhei Sutou	2018-09-11 11:56:46 +0900 (Tue, 11 Sep 2018)

  Revision: 02d8a47f5d71bd4909d8dd96817ae720acffdc85
  https://github.com/groonga/groonga/commit/02d8a47f5d71bd4909d8dd96817ae720acffdc85

  Message:
    Fix a memory leak

  Modified files:
    lib/proc/proc_tokenize.c

  Modified: lib/proc/proc_tokenize.c (+4 -0)
===================================================================
--- lib/proc/proc_tokenize.c    2018-09-11 11:13:52 +0900 (60f570bed)
+++ lib/proc/proc_tokenize.c    2018-09-11 11:56:46 +0900 (9bf0b0c06)
@@ -269,6 +269,8 @@ tokenize(grn_ctx *ctx,
       GRN_TEXT_INIT(&name, 0);
       GRN_VOID_INIT(&value);
       for (i = 0; i < n_metadata; i++) {
+        GRN_BULK_REWIND(&name);
+        GRN_BULK_REWIND(&value);
         grn_token_metadata_at(ctx, metadata, i, &name, &value);
         if (GRN_TEXT_LEN(&name) == 0) {
           continue;
@@ -286,6 +288,8 @@ tokenize(grn_ctx *ctx,
                                0,
                                value.header.domain);
       }
+      GRN_OBJ_FIN(ctx, &name);
+      GRN_OBJ_FIN(ctx, &value);
     }
   }
   grn_token_cursor_close(ctx, token_cursor);
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180911/b1c56df6/attachment.htm 



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