mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
Minor pg_dump improvements
Improve pg_dump by checking results on various fgetc() calls which previously were unchecked, ditto for ftello. Also clean up a couple of very minor memory leaks by waiting to allocate structures until after the initial check(s). Issues spotted by Coverity.
This commit is contained in:
@ -708,6 +708,9 @@ _CloseArchive(ArchiveHandle *AH)
|
||||
{
|
||||
WriteHead(AH);
|
||||
tpos = ftello(AH->FH);
|
||||
if (tpos < 0 || errno)
|
||||
exit_horribly(modulename, "could not determine seek position in archive file: %s\n",
|
||||
strerror(errno));
|
||||
WriteToc(AH);
|
||||
ctx->dataStart = _getFilePos(AH, ctx);
|
||||
WriteDataChunks(AH, NULL);
|
||||
@ -756,7 +759,7 @@ _ReopenArchive(ArchiveHandle *AH)
|
||||
|
||||
errno = 0;
|
||||
tpos = ftello(AH->FH);
|
||||
if (errno)
|
||||
if (tpos < 0 || errno)
|
||||
exit_horribly(modulename, "could not determine seek position in archive file: %s\n",
|
||||
strerror(errno));
|
||||
|
||||
|
Reference in New Issue
Block a user