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>
}
ret = dh_is_pubkey_valid(ctx, base);
if (ret)
- goto err_free_val;
+ goto err_free_base;
} else {
base = ctx->g;
}