提交 a5bca4ef 编写于 作者: R Robert Haas

Plug more memory leaks when reloading config file.

Commit 138184ad plugged some but not
all of the leaks from commit 2a0c81a1.
This tightens things up some more.

Amit Kapila, per an observation by Tom Lane
上级 d2458e3b
......@@ -469,18 +469,22 @@ ParseConfigFile(const char *config_file, const char *calling_file, bool strict,
(errcode_for_file_access(),
errmsg("could not open configuration file \"%s\": %m",
abs_path)));
return false;
OK = false;
goto cleanup;
}
ereport(LOG,
(errmsg("skipping missing configuration file \"%s\"",
abs_path)));
return OK;
OK = true;
goto cleanup;
}
OK = ParseConfigFp(fp, abs_path, depth, elevel, head_p, tail_p);
FreeFile(fp);
cleanup:
if (fp)
FreeFile(fp);
pfree(abs_path);
return OK;
......@@ -748,7 +752,8 @@ ParseConfigDirectory(const char *includedir,
(errcode_for_file_access(),
errmsg("could not open configuration directory \"%s\": %m",
directory)));
return false;
status = false;
goto cleanup;
}
/*
......@@ -803,7 +808,8 @@ ParseConfigDirectory(const char *includedir,
(errcode_for_file_access(),
errmsg("could not stat file \"%s\": %m",
filename)));
return false;
status = false;
goto cleanup;
}
}
......@@ -824,7 +830,9 @@ ParseConfigDirectory(const char *includedir,
status = true;
cleanup:
FreeDir(d);
if (d)
FreeDir(d);
pfree(directory);
return status;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册