Skip to content

Commit 3fd8093

Browse files
GustavoARSilvaherbertx
authored andcommitted
crypto: dh - fix memory leak
In case memory resources for *base* were allocated, release them before return. Addresses-Coverity-ID: 1471702 ("Resource leak") Fixes: e3fe0ae ("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>
1 parent d6be72e commit 3fd8093

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎crypto/dh.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static int dh_compute_value(struct kpp_request *req)
174174
}
175175
ret = dh_is_pubkey_valid(ctx, base);
176176
if (ret)
177-
goto err_free_val;
177+
goto err_free_base;
178178
} else {
179179
base = ctx->g;
180180
}

0 commit comments

Comments
 (0)