Merge pull request #1423

19585d49 mnemonics: fix misc STL containers leak (moneromooo-monero)
f6fcf0ef oaes_lib: fix a leak on OOM error path (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2016-12-12 22:37:32 +02:00
commit 7141d317df
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD
2 changed files with 9 additions and 0 deletions

View File

@ -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 )); _key->data = (uint8_t *) calloc( key_size, sizeof( uint8_t ));
if( NULL == _key->data ) if( NULL == _key->data )
{
free( _key );
return OAES_RET_MEM; return OAES_RET_MEM;
}
for( _i = 0; _i < key_size; _i++ ) for( _i = 0; _i < key_size; _i++ )
#ifdef OAES_HAVE_ISAAC #ifdef OAES_HAVE_ISAAC

View File

@ -106,6 +106,12 @@ namespace Language
trimmed_word_map = new std::unordered_map<std::string, uint32_t>; trimmed_word_map = new std::unordered_map<std::string, uint32_t>;
unique_prefix_length = 4; unique_prefix_length = 4;
} }
virtual ~Base()
{
delete word_list;
delete word_map;
delete trimmed_word_map;
}
/*! /*!
* \brief Returns a pointer to the word list. * \brief Returns a pointer to the word list.
* \return A pointer to the word list. * \return A pointer to the word list.