[Groonga-commit] groonga/groonga at 4852629 [master] Free resources as soon as possible

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Apr 10 16:10:36 JST 2016


Kouhei Sutou	2016-04-10 16:10:36 +0900 (Sun, 10 Apr 2016)

  New Revision: 4852629053cb82f3776ab7cf550815de59d8824c
  https://github.com/groonga/groonga/commit/4852629053cb82f3776ab7cf550815de59d8824c

  Message:
    Free resources as soon as possible

  Modified files:
    lib/proc/proc_select.c

  Modified: lib/proc/proc_select.c (+5 -5)
===================================================================
--- lib/proc/proc_select.c    2016-04-10 16:07:56 +0900 (caa1e4f)
+++ lib/proc/proc_select.c    2016-04-10 16:10:36 +0900 (1c255d0)
@@ -582,7 +582,9 @@ grn_select_drilldowns(grn_ctx *ctx, grn_obj *table,
   if (!drilldown_info_tsort(ctx, labels,
                             drilldowns, n_drilldowns, &tsorted_indexes)) {
     /* cyclic */
-    goto exit;
+    GRN_OBJ_FIN(ctx, &tsorted_indexes);
+    grn_obj_close(ctx, labels);
+    return;
   }
 
   results = GRN_PLUGIN_MALLOCN(ctx, grn_table_group_result, n_drilldowns);
@@ -636,6 +638,8 @@ grn_select_drilldowns(grn_ctx *ctx, grn_obj *table,
     grn_table_group(ctx, target_table, keys, n_keys, &(results[j]), 1);
     grn_table_sort_key_close(ctx, keys, n_keys);
   }
+  GRN_OBJ_FIN(ctx, &tsorted_indexes);
+  grn_obj_close(ctx, labels);
 
   GRN_OUTPUT_MAP_OPEN("DRILLDOWNS", n_drilldowns);
   for (i = 0; i < n_drilldowns; i++) {
@@ -698,10 +702,6 @@ grn_select_drilldowns(grn_ctx *ctx, grn_obj *table,
   }
   GRN_OUTPUT_MAP_CLOSE();
   GRN_PLUGIN_FREE(ctx, results);
-
-exit :
-  GRN_OBJ_FIN(ctx, &tsorted_indexes);
-  grn_obj_unlink(ctx, labels);
 }
 
 static grn_rc
-------------- next part --------------
HTML����������������������������...
Télécharger 



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