mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-01 19:45:33 +08:00
Fix nasty memory leak in pg_restore: _PrintData called inflateInit but
never did inflateEnd, thus leaking some tens of KB per call. Which added up *real fast* when dealing with, say, thousands of BLOBs. Thanks to Lane Rollins for the bug report.
This commit is contained in:
parent
1e99bf5e4c
commit
e7257b8eb2
@ -19,7 +19,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.16 2001/10/25 05:49:52 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.17 2001/11/27 23:48:12 tgl Exp $
|
||||||
*
|
*
|
||||||
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
|
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
|
||||||
*
|
*
|
||||||
@ -622,6 +622,8 @@ _PrintData(ArchiveHandle *AH)
|
|||||||
out[zlibOutSize - zp->avail_out] = '\0';
|
out[zlibOutSize - zp->avail_out] = '\0';
|
||||||
ahwrite(out, 1, zlibOutSize - zp->avail_out, AH);
|
ahwrite(out, 1, zlibOutSize - zp->avail_out, AH);
|
||||||
}
|
}
|
||||||
|
if (inflateEnd(zp) != Z_OK)
|
||||||
|
die_horribly(AH, modulename, "could not close compression library: %s\n", zp->msg);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user