From f6fcf0ef2647e7dc0a5912a1e14785bc8bc7a1a1 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 10 Dec 2016 12:38:56 +0000 Subject: [PATCH 1/2] oaes_lib: fix a leak on OOM error path found by coverity --- src/crypto/oaes_lib.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/crypto/oaes_lib.c b/src/crypto/oaes_lib.c index 4c144689..2cf598e0 100644 --- a/src/crypto/oaes_lib.c +++ b/src/crypto/oaes_lib.c @@ -639,7 +639,10 @@ static OAES_RET oaes_key_gen( OAES_CTX * ctx, size_t key_size ) _key->data = (uint8_t *) calloc( key_size, sizeof( uint8_t )); if( NULL == _key->data ) + { + free( _key ); return OAES_RET_MEM; + } for( _i = 0; _i < key_size; _i++ ) #ifdef OAES_HAVE_ISAAC From 19585d49142cdf0eb6b82bd4c3c6d813da12c35c Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 10 Dec 2016 12:39:25 +0000 Subject: [PATCH 2/2] mnemonics: fix misc STL containers leak found by coverity --- src/mnemonics/language_base.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mnemonics/language_base.h b/src/mnemonics/language_base.h index 9a60f8a5..e0297c84 100644 --- a/src/mnemonics/language_base.h +++ b/src/mnemonics/language_base.h @@ -106,6 +106,12 @@ namespace Language trimmed_word_map = new std::unordered_map; unique_prefix_length = 4; } + virtual ~Base() + { + delete word_list; + delete word_map; + delete trimmed_word_map; + } /*! * \brief Returns a pointer to the word list. * \return A pointer to the word list.