diff options
author | Keith Bostic <keith@wiredtiger.com> | 2013-11-16 08:28:21 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2013-11-16 08:28:21 -0500 |
commit | 8f79e541e4c913452d84d256c72e217c7a0062fa (patch) | |
tree | a66df7b40bd4888ca348a7eda51c4fcd55ef3c4e /src/bloom/bloom.c | |
parent | 97cda1daab11bf42a2f1a024405a58688eeaaac6 (diff) | |
download | mongo-8f79e541e4c913452d84d256c72e217c7a0062fa.tar.gz |
Coverity: Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "bloom" going out of scope leaks the storage
it points to.
Diffstat (limited to 'src/bloom/bloom.c')
-rw-r--r-- | src/bloom/bloom.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bloom/bloom.c b/src/bloom/bloom.c index 5dd91a7c99f..8ccf3b8cc13 100644 --- a/src/bloom/bloom.c +++ b/src/bloom/bloom.c @@ -96,13 +96,18 @@ __wt_bloom_create( uint64_t count, uint32_t factor, uint32_t k, WT_BLOOM **bloomp) { WT_BLOOM *bloom; + WT_DECL_RET; + WT_RET(__bloom_init(session, uri, config, &bloom)); - WT_RET(__bloom_setup(bloom, count, 0, factor, k)); + WT_ERR(__bloom_setup(bloom, count, 0, factor, k)); - WT_RET(__bit_alloc(session, bloom->m, &bloom->bitstring)); + WT_ERR(__bit_alloc(session, bloom->m, &bloom->bitstring)); *bloomp = bloom; return (0); + +err: (void)__wt_bloom_close(bloom); + return (ret); } /* |