aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Frost <sfrost@snowman.net>2013-07-14 15:31:23 -0400
committerStephen Frost <sfrost@snowman.net>2013-07-14 15:31:23 -0400
commitd368a301b3a4bf5fec17e81c630adddeac80a7fc (patch)
tree99deb30d128b40387a3e96cef81700680588a633 /src
parent234e4cf6e1eac2f0e514379a2a533ffb71b33732 (diff)
downloadpostgresql-d368a301b3a4bf5fec17e81c630adddeac80a7fc.tar.gz
postgresql-d368a301b3a4bf5fec17e81c630adddeac80a7fc.zip
pg_receivexlog - Exit on failure to parse
In streamutil.c:GetConnection(), upgrade failure to parse the connection string to an exit(1) instead of simply returning NULL. Most callers already immediately exited, but pg_receivexlog would loop on this case, continually trying to re-parse the connection string (which can't be changed after pg_receivexlog has started). GetConnection() was already expected to exit(1) in some cases (eg: failure to allocate memory or if unable to determine the integer_datetimes flag), so this change shouldn't surprise anyone. Began looking at this due to the Coverity scanner complaining that we were leaking err_msg in this case- no longer an issue since we just exit(1) immediately.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_basebackup/streamutil.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c
index 6891c2c8105..dab0e5470cf 100644
--- a/src/bin/pg_basebackup/streamutil.c
+++ b/src/bin/pg_basebackup/streamutil.c
@@ -57,7 +57,7 @@ GetConnection(void)
if (conn_opts == NULL)
{
fprintf(stderr, "%s: %s\n", progname, err_msg);
- return NULL;
+ exit(1);
}
for (conn_opt = conn_opts; conn_opt->keyword != NULL; conn_opt++)