[Groonga-commit] pgroonga/pgroonga at a67ef14 [master] Free allocated memory immediately

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Jul 26 17:07:23 JST 2015


Kouhei Sutou	2015-07-26 17:07:23 +0900 (Sun, 26 Jul 2015)

  New Revision: a67ef14bd26c73db3101f9ccff4987b9be3239ae
  https://github.com/pgroonga/pgroonga/commit/a67ef14bd26c73db3101f9ccff4987b9be3239ae

  Message:
    Free allocated memory immediately

  Modified files:
    pgroonga.c

  Modified: pgroonga.c (+4 -1)
===================================================================
--- pgroonga.c    2015-07-26 17:05:51 +0900 (b487292)
+++ pgroonga.c    2015-07-26 17:07:23 +0900 (548b65c)
@@ -266,14 +266,17 @@ PGrnInitializeVariables(void)
 static void
 PGrnEnsureDatabase(void)
 {
+	char *databasePath;
 	char path[MAXPGPATH];
 	grn_obj	*db;
 	pgrn_stat_buffer file_status;
 
 	GRN_CTX_SET_ENCODING(ctx, PGrnGetEncoding());
+	databasePath = GetDatabasePath(MyDatabaseId, DEFAULTTABLESPACE_OID);
 	join_path_components(path,
-						 GetDatabasePath(MyDatabaseId, DEFAULTTABLESPACE_OID),
+						 databasePath,
 						 PGrnDatabaseBasename);
+	pfree(databasePath);
 
 	if (pgrn_stat(path, &file_status) == 0)
 	{
-------------- next part --------------
HTML����������������������������...
Download 



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