Content-Length: 274773 | pFad | http://github.com/postgrespro/postgres/commit/e7257b8eb21345b6dc340b236a9213e079d05fba

86 Fix nasty memory leak in pg_restore: _PrintData called inflateInit but · postgrespro/postgres@e7257b8 · GitHub
Skip to content

Commit e7257b8

Browse files
committed
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.
1 parent 1e99bf5 commit e7257b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bin/pg_dump/pg_backup_custom.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
*
2121
* IDENTIFICATION
22-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.16 2001/10/25 05:49:52 momjian Exp $
22+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.17 2001/11/27 23:48:12 tgl Exp $
2323
*
2424
* Modifications - 28-Jun-2000 - pjw@rhyme.com.au
2525
*
@@ -622,6 +622,8 @@ _PrintData(ArchiveHandle *AH)
622622
out[zlibOutSize - zp->avail_out] = '\0';
623623
ahwrite(out, 1, zlibOutSize - zp->avail_out, AH);
624624
}
625+
if (inflateEnd(zp) != Z_OK)
626+
die_horribly(AH, modulename, "could not close compression library: %s\n", zp->msg);
625627
}
626628
#endif
627629

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/e7257b8eb21345b6dc340b236a9213e079d05fba

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy