diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2015-02-15 09:17:39 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2015-02-15 09:17:39 +0000 |
commit | c1c0c9b85d412ab7eb2102a1e3f61ef03f1f2ea6 (patch) | |
tree | 1f1639d49bcf6e4ae9e52631cc7e7398dc5394fc /regress | |
parent | da9fe4d4b5902300e187e02016d3c6c9da5b0236 (diff) |
Memory leak. Coverity CID 78865
Diffstat (limited to 'regress')
-rw-r--r-- | regress/lib/libcrypto/aeswrap/aes_wrap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/regress/lib/libcrypto/aeswrap/aes_wrap.c b/regress/lib/libcrypto/aeswrap/aes_wrap.c index c0c56327f1f..292ce5e895f 100644 --- a/regress/lib/libcrypto/aeswrap/aes_wrap.c +++ b/regress/lib/libcrypto/aeswrap/aes_wrap.c @@ -68,10 +68,11 @@ AES_wrap_unwrap_test(const unsigned char *kek, int keybits, unsigned char *otmp = NULL, *ptmp = NULL; int r, ret = 0; AES_KEY wctx; + otmp = malloc(keylen + 8); ptmp = malloc(keylen); - if (!otmp || !ptmp) - return 0; + if (otmp == NULL || ptmp == NULL) + goto err; if (AES_set_encrypt_key(kek, keybits, &wctx)) goto err; r = AES_wrap_key(&wctx, iv, otmp, key, keylen); |