aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-12-10 12:38:56 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-12-10 12:51:20 +0000
commitf6fcf0ef2647e7dc0a5912a1e14785bc8bc7a1a1 (patch)
tree2dca9a376bfc9ad32f924103a18f173c40afa1f8
parentMerge pull request #1422 (diff)
downloadmonero-f6fcf0ef2647e7dc0a5912a1e14785bc8bc7a1a1.tar.xz
oaes_lib: fix a leak on OOM error path
found by coverity
-rw-r--r--src/crypto/oaes_lib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/crypto/oaes_lib.c b/src/crypto/oaes_lib.c
index 4c1446898..2cf598e05 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