diff options
author | Luke Chen <luke.chen@mongodb.com> | 2018-08-06 13:51:22 +1000 |
---|---|---|
committer | Luke Chen <luke.chen@mongodb.com> | 2018-08-06 13:51:22 +1000 |
commit | 063f0b27cfc73cb089b2e76a5fe534b39934ffa4 (patch) | |
tree | 5674b788c4999a4db24bbff46125bcad2c2673b4 /src/third_party/wiredtiger/ext/compressors/zlib/zlib_compress.c | |
parent | e49247580c76ccdd4013ff0357e03d0b1c95cbb6 (diff) | |
download | mongo-063f0b27cfc73cb089b2e76a5fe534b39934ffa4.tar.gz |
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
Diffstat (limited to 'src/third_party/wiredtiger/ext/compressors/zlib/zlib_compress.c')
-rw-r--r-- | src/third_party/wiredtiger/ext/compressors/zlib/zlib_compress.c | 9 |
1 files changed, 7 insertions, 2 deletions
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); } /* |