From 063f0b27cfc73cb089b2e76a5fe534b39934ffa4 Mon Sep 17 00:00:00 2001 From: Luke Chen Date: Mon, 6 Aug 2018 13:51:22 +1000 Subject: Import wiredtiger: 65531924e397aeb55f6835b73e4c199ea378ec97 from branch mongodb-4.2 ref: 376f355fb0..65531924e3 for: 4.1.2 WT-3968 Use compression ratio to tune page sizes WT-4010 Simplify test/format timestamp handling. WT-4134 Rework assertion that we don't discard required history WT-4201 Fix Coverity static analysis issues WT-4206 Fix error handling in cursor close routines WT-4208 tree walks can be interrupted by locked internal pages WT-4213 Rename lock statistics that have redundant or misleading text WT-4226 test/format LSM configurations can misconfigure prepare and timestamps --- src/third_party/wiredtiger/ext/compressors/zlib/zlib_compress.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/third_party/wiredtiger/ext/compressors/zlib/zlib_compress.c') diff --git a/src/third_party/wiredtiger/ext/compressors/zlib/zlib_compress.c b/src/third_party/wiredtiger/ext/compressors/zlib/zlib_compress.c index 5ae54a25163..d5c0d0fb318 100644 --- a/src/third_party/wiredtiger/ext/compressors/zlib/zlib_compress.c +++ b/src/third_party/wiredtiger/ext/compressors/zlib/zlib_compress.c @@ -452,6 +452,7 @@ zlib_add_compressor( WT_CONNECTION *connection, bool raw, const char *name, int zlib_level) { ZLIB_COMPRESSOR *zlib_compressor; + int ret; /* * There are two almost identical zlib compressors: one using raw @@ -471,8 +472,12 @@ zlib_add_compressor( zlib_compressor->zlib_level = zlib_level; /* Load the compressor. */ - return (connection->add_compressor( - connection, name, (WT_COMPRESSOR *)zlib_compressor, NULL)); + if ((ret = connection->add_compressor( + connection, name, (WT_COMPRESSOR *)zlib_compressor, NULL)) == 0) + return (0); + + free(zlib_compressor); + return (ret); } /* -- cgit v1.2.1