Skip to content

Commit 122f88b

Browse files
committed
[PBCKP-101] fix accessing already freed memory
1 parent c5dc624 commit 122f88b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/restore.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ do_restore_or_validate(time_t target_backup_id, pgRecoveryTarget *rt,
9999
{
100100
int i = 0;
101101
int j = 0;
102-
parray *backups;
102+
parray *backups = NULL;
103103
pgBackup *tmp_backup = NULL;
104104
pgBackup *current_backup = NULL;
105105
pgBackup *dest_backup = NULL;
@@ -475,13 +475,14 @@ do_restore_or_validate(time_t target_backup_id, pgRecoveryTarget *rt,
475475
/* ssh connection to longer needed */
476476
fio_disconnect();
477477

478+
elog(INFO, "%s of backup %s completed.",
479+
action, base36enc(dest_backup->start_time));
480+
478481
/* cleanup */
479482
parray_walk(backups, pgBackupFree);
480483
parray_free(backups);
481484
parray_free(parent_chain);
482485

483-
elog(INFO, "%s of backup %s completed.",
484-
action, base36enc(dest_backup->start_time));
485486
return 0;
486487
}
487488

0 commit comments

Comments
 (0)