[Groonga-commit] groonga/groonga [master] [test] fixed a memory leak.

Back to archive index

null+****@clear***** null+****@clear*****
2012年 2月 8日 (水) 17:36:33 JST


Kouhei Sutou	2012-02-08 17:36:33 +0900 (Wed, 08 Feb 2012)

  New Revision: d4ab92aadc182b141e3f0b029635cf95f227aa5a

  Log:
    [test] fixed a memory leak.

  Modified files:
    test/unit/lib/grn-test-utils.c

  Modified: test/unit/lib/grn-test-utils.c (+4 -1)
===================================================================
--- test/unit/lib/grn-test-utils.c    2012-02-08 09:42:29 +0900 (01275a3)
+++ test/unit/lib/grn-test-utils.c    2012-02-08 17:36:33 +0900 (21ea956)
@@ -651,6 +651,7 @@ grn_test_send_command(grn_ctx *context, const gchar *command)
   unsigned int send_id, receive_id;
   GString *result;
   const gchar **lines;
+  const gchar *taken_result;
 
   result = g_string_new(NULL);
   lines = cut_take_string_array(g_strsplit(command, "\n", 0));
@@ -671,7 +672,9 @@ grn_test_send_command(grn_ctx *context, const gchar *command)
                             cut_message("<%s>:<%s>", command, result->str));
   }
 
-  return cut_take_strdup(g_string_free(result, FALSE));
+  taken_result = cut_take_strdup(result->str);
+  g_string_free(result, TRUE);
+  return taken_result;
 }
 
 void




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