From db901a7adfec1e2655394747406c74f3d6e57ccf Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Tue, 6 Aug 2019 00:00:34 +0300 Subject: [PATCH] [Issue #103] minor fix --- src/delete.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/delete.c b/src/delete.c index a4350144..5a3c37f5 100644 --- a/src/delete.c +++ b/src/delete.c @@ -633,7 +633,7 @@ do_retention_wal(void) /* Save LSN and Timeline to remove unnecessary WAL segments */ for (i = (int) parray_num(backup_list) - 1; i >= 0; i--) { - pgBackup *backup = (pgBackup *) parray_get(backup_list, parray_num(backup_list) -1); + pgBackup *backup = (pgBackup *) parray_get(backup_list, i); /* Get LSN and TLI of the oldest backup with valid start_lsn and tli */ if (backup->tli > 0 && !XLogRecPtrIsInvalid(backup->start_lsn))