mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Fix double free in standby clone
This commit is contained in:
10
repmgr.c
10
repmgr.c
@@ -1035,6 +1035,10 @@ stop_backup:
|
||||
log_info(_("%s requires primary to keep WAL files %s until at least %s\n"),
|
||||
progname, first_wal_segment, last_wal_segment);
|
||||
|
||||
/* Finished with the database connection now */
|
||||
PQclear(res);
|
||||
PQfinish(conn);
|
||||
|
||||
/*
|
||||
* Only free the first_wal_segment since it was copied out of the
|
||||
* pqresult.
|
||||
@@ -1042,9 +1046,6 @@ stop_backup:
|
||||
free(first_wal_segment);
|
||||
first_wal_segment = NULL;
|
||||
|
||||
PQclear(res);
|
||||
PQfinish(conn);
|
||||
|
||||
/* If the rsync failed then exit */
|
||||
if (r != 0)
|
||||
exit(ERR_BAD_RSYNC);
|
||||
@@ -1064,9 +1065,6 @@ stop_backup:
|
||||
/* Finally, write the recovery.conf file */
|
||||
create_recovery_file(runtime_options.dest_dir, NULL);
|
||||
|
||||
PQclear(res);
|
||||
PQfinish(conn);
|
||||
|
||||
/*
|
||||
* We don't start the service yet because we still may want to
|
||||
* move the directory
|
||||
|
||||
Reference in New Issue
Block a user