summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-11-27 23:48:12 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-11-27 23:48:12 +0000
commite7257b8eb21345b6dc340b236a9213e079d05fba (patch)
treec9b0a33b5cec12af43412d1e986fe8dc6f761b72 /src
parent1e99bf5e4cfb7c963a77f672efe6209b7202ac27 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_backup_custom.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/pg_dump/pg_backup_custom.c b/src/bin/pg_dump/pg_backup_custom.c
index c6d9ff51236..314e90d4df7 100644
--- a/src/bin/pg_dump/pg_backup_custom.c
+++ b/src/bin/pg_dump/pg_backup_custom.c
@@ -19,7 +19,7 @@
*
*
* 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
*
@@ -622,6 +622,8 @@ _PrintData(ArchiveHandle *AH)
out[zlibOutSize - zp->avail_out] = '\0';
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