mirror of
https://github.com/monero-project/monero.git
synced 2024-12-14 04:16:32 +02:00
oaes_lib: fix a leak on OOM error path
found by coverity
This commit is contained in:
parent
2d0fbaf35b
commit
f6fcf0ef26
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user