diff --git a/src/bin/pg_dump/pg_backup_tar.c b/src/bin/pg_dump/pg_backup_tar.c
index c5e19968b7c61efe85d5059b94d62287c9d795ec..67527b75850d43011763ac3d722b9ff198bb65fe 100644
--- a/src/bin/pg_dump/pg_backup_tar.c
+++ b/src/bin/pg_dump/pg_backup_tar.c
@@ -862,6 +862,7 @@ _CloseArchive(ArchiveHandle *AH)
 
 		ropt = NewRestoreOptions();
 		memcpy(ropt, AH->ropt, sizeof(RestoreOptions));
+		ropt->filename = NULL;
 		ropt->dropSchema = 1;
 		ropt->compression = 0;
 		ropt->superuser = NULL;