summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2018-07-10 17:22:52 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2018-07-20 08:51:21 +0300
commit3fd8093b41e745448ffeb0a0d3becc2cd1f9d7ad (patch)
tree5ba2cdea55b27cb0fd47277de8c8f1cd7f9d465b /crypto
parentd6be72ee2c77469d4fb391ccccc2ebc1b167a242 (diff)
downloadlinux-3fd8093b41e745448ffeb0a0d3becc2cd1f9d7ad.tar.xz
crypto: dh - fix memory leak
In case memory resources for *base* were allocated, release them before return. Addresses-Coverity-ID: 1471702 ("Resource leak") Fixes: e3fe0ae12962 ("crypto: dh - add public key verification test") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Stephan Müller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/dh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/dh.c b/crypto/dh.c
index 8f79269db2b7..09a44de4209d 100644
--- a/crypto/dh.c
+++ b/crypto/dh.c
@@ -174,7 +174,7 @@ static int dh_compute_value(struct kpp_request *req)
}
ret = dh_is_pubkey_valid(ctx, base);
if (ret)
- goto err_free_val;
+ goto err_free_base;
} else {
base = ctx->g;
}