aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/oaes_lib.c
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-12-12 22:37:32 +0200
committerRiccardo Spagni <ric@spagni.net>2016-12-12 22:37:32 +0200
commit7141d317df7201db51a87710441359923687744f (patch)
tree6cbdeb4005d2e21917a686cfb65541384c9829f0 /src/crypto/oaes_lib.c
parentMerge pull request #1422 (diff)
parentmnemonics: fix misc STL containers leak (diff)
downloadmonero-7141d317df7201db51a87710441359923687744f.tar.xz
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)
Diffstat (limited to 'src/crypto/oaes_lib.c')
-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