diff --git a/src/bin/pg_rewind/fetch.cpp b/src/bin/pg_rewind/fetch.cpp index 03ad5b58f..19d818eba 100755 --- a/src/bin/pg_rewind/fetch.cpp +++ b/src/bin/pg_rewind/fetch.cpp @@ -123,6 +123,8 @@ BuildErrorCode libpqGetParameters(void) } str2 = run_simple_query("SHOW enable_incremental_checkpoint"); if (str2 == NULL) { + pg_free(str); + str = NULL; return BUILD_FATAL; } if (strcmp(str, "on") != 0 && strcmp(str2, "on") != 0) {