File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -960,11 +960,18 @@ pg_stop_backup(pgBackup *backup)
960
960
fclose (fp );
961
961
962
962
/* TODO What for do we save the file into backup_list? */
963
- file = pgFileNew (backup_label , true);
964
- calc_file_checksum (file );
965
- free (file -> path );
966
- file -> path = strdup (PG_BACKUP_LABEL_FILE );
967
- parray_append (backup_files_list , file );
963
+ /*
964
+ * It's vital to check if backup_files_list is initialized,
965
+ * because we could get here because the backup was interrupted
966
+ */
967
+ if (backup_files_list )
968
+ {
969
+ file = pgFileNew (backup_label , true);
970
+ calc_file_checksum (file );
971
+ free (file -> path );
972
+ file -> path = strdup (PG_BACKUP_LABEL_FILE );
973
+ parray_append (backup_files_list , file );
974
+ }
968
975
969
976
/* Write tablespace_map */
970
977
if (strlen (PQgetvalue (res , 0 , 2 )) > 0 )
You can’t perform that action at this time.
0 commit comments