[Groonga-mysql-commit] mroonga/mroonga at ca20ae4 [master] Fix a memory leak

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Apr 25 17:07:03 JST 2018


Kouhei Sutou	2018-01-29 18:06:27 +0900 (Mon, 29 Jan 2018)

  New Revision: ca20ae45feceea0acdb7f12657d9a6226919b8a0
  https://github.com/mroonga/mroonga/commit/ca20ae45feceea0acdb7f12657d9a6226919b8a0

  Message:
    Fix a memory leak
    
    Column caches aren't freed.

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+3 -4)
===================================================================
--- ha_mroonga.cpp    2018-04-25 16:21:11 +0900 (08304a2a)
+++ ha_mroonga.cpp    2018-01-29 18:06:27 +0900 (447c193c)
@@ -5076,6 +5076,8 @@ void ha_mroonga::storage_close_columns(void)
 
   free(grn_columns);
   grn_columns = NULL;
+  free(grn_column_caches);
+  grn_column_caches = NULL;
   free(grn_column_ranges);
   grn_column_ranges = NULL;
 }
@@ -5266,11 +5268,8 @@ int ha_mroonga::wrapper_close()
 int ha_mroonga::storage_close()
 {
   MRN_DBUG_ENTER_METHOD();
+  storage_close_columns();
   grn_obj_unlink(ctx, grn_table);
-  // TODO: unlink elements
-  free(grn_columns);
-  // TODO: unlink elements
-  free(grn_column_ranges);
   DBUG_RETURN(0);
 }
 
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-mysql-commit/attachments/20180425/e37b0a08/attachment.htm 



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