mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 00:26:30 +00:00
Avoid a use-after-free in verbose logging
Previously, this print would use memory freed by PQClear previously. Signed-off-by: Dan Farina <drfarina@acm.org>
This commit is contained in:
11
repmgr.c
11
repmgr.c
@@ -974,6 +974,12 @@ stop_backup:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
last_wal_segment = PQgetvalue(res, 0, 0);
|
last_wal_segment = PQgetvalue(res, 0, 0);
|
||||||
|
|
||||||
|
if (verbose)
|
||||||
|
printf(
|
||||||
|
_("%s requires primary to keep WAL files %s until at least %s\n"),
|
||||||
|
progname, first_wal_segment, last_wal_segment);
|
||||||
|
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
PQfinish(conn);
|
PQfinish(conn);
|
||||||
|
|
||||||
@@ -981,11 +987,6 @@ stop_backup:
|
|||||||
if (r != 0)
|
if (r != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (verbose)
|
|
||||||
printf(
|
|
||||||
_("%s requires primary to keep WAL files %s until at least %s\n"),
|
|
||||||
progname, first_wal_segment, last_wal_segment);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We need to create the pg_xlog sub directory too, I'm reusing a variable
|
* We need to create the pg_xlog sub directory too, I'm reusing a variable
|
||||||
* here.
|
* here.
|
||||||
|
|||||||
Reference in New Issue
Block a user