diff --git a/src/backend/utils/misc/guc-file.l b/src/backend/utils/misc/guc-file.l
index b730a12..e94f53d 100644
--- a/src/backend/utils/misc/guc-file.l
+++ b/src/backend/utils/misc/guc-file.l
@@ -411,6 +411,7 @@ ParseConfigFile(const char *config_file, const char *calling_file, bool strict,
 {
 	bool		OK = true;
 	FILE	   *fp;
+	char       *abs_config_file;
 
 	/*
 	 * Reject too-deep include nesting depth.  This is just a safety check
@@ -426,8 +427,8 @@ ParseConfigFile(const char *config_file, const char *calling_file, bool strict,
 		return false;
 	}
 
-	config_file = AbsoluteConfigLocation(config_file,calling_file);
-	fp = AllocateFile(config_file, "r");
+	abs_config_file = AbsoluteConfigLocation(config_file,calling_file);
+	fp = AllocateFile(abs_config_file, "r");
 	if (!fp)
 	{
 		if (strict)
@@ -435,19 +436,22 @@ ParseConfigFile(const char *config_file, const char *calling_file, bool strict,
 			ereport(elevel,
 					(errcode_for_file_access(),
 					 errmsg("could not open configuration file \"%s\": %m",
-							config_file)));
+							abs_config_file)));
+			pfree(abs_config_file);
 			return false;
 		}
 
 		ereport(LOG,
 				(errmsg("skipping missing configuration file \"%s\"",
-						config_file)));
+						abs_config_file)));
+		pfree(abs_config_file);
 		return OK;
-	}
+   }
 
-	OK = ParseConfigFp(fp, config_file, depth, elevel, head_p, tail_p);
+   OK = ParseConfigFp(fp, abs_config_file, depth, elevel, head_p, tail_p);
 
 	FreeFile(fp);
+	pfree(abs_config_file);
 
 	return OK;
 }
