aboutsummaryrefslogtreecommitdiff
path: root/src/bin/pg_upgrade/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_upgrade/exec.c')
-rw-r--r--src/bin/pg_upgrade/exec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bin/pg_upgrade/exec.c b/src/bin/pg_upgrade/exec.c
index fec8dc4c2f7..3552cf00afb 100644
--- a/src/bin/pg_upgrade/exec.c
+++ b/src/bin/pg_upgrade/exec.c
@@ -431,7 +431,7 @@ static void
check_exec(const char *dir, const char *program, bool check_version)
{
char path[MAXPGPATH];
- char line[MAXPGPATH];
+ char *line;
char cmd[MAXPGPATH];
char versionstr[128];
@@ -442,7 +442,7 @@ check_exec(const char *dir, const char *program, bool check_version)
snprintf(cmd, sizeof(cmd), "\"%s\" -V", path);
- if (!pipe_read_line(cmd, line, sizeof(line)))
+ if ((line = pipe_read_line(cmd)) == NULL)
pg_fatal("check for \"%s\" failed: cannot execute",
path);
@@ -456,4 +456,6 @@ check_exec(const char *dir, const char *program, bool check_version)
pg_fatal("check for \"%s\" failed: incorrect version: found \"%s\", expected \"%s\"",
path, line, versionstr);
}
+
+ pg_free(line);
}