diff --git a/src/bin/pg_basebackup/streamutil.c b/src/bin/pg_basebackup/streamutil.c index 52f1e559b7..e9a2739f8e 100644 --- a/src/bin/pg_basebackup/streamutil.c +++ b/src/bin/pg_basebackup/streamutil.c @@ -321,9 +321,12 @@ RetrieveWalSegSize(PGconn *conn) { fprintf(stderr, _("%s: WAL segment size could not be parsed\n"), progname); + PQclear(res); return false; } + PQclear(res); + /* set the multiplier based on unit to convert xlog_val to bytes */ if (strcmp(xlog_unit, "MB") == 0) multiplier = 1024 * 1024; @@ -343,7 +346,6 @@ RetrieveWalSegSize(PGconn *conn) return false; } - PQclear(res); return true; }