Skip to contentSkip to conversation

crypto: dh - fix memory leak

PATCH In review Gustavo A. R. Silva 3 participants 4 messages Jul 10, 2018 – Jul 20, 2018 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 crypto/dh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/dh.c +1 -1
index 8f79269..09a44de 100644
@@ -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;
 	}
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw

Am Dienstag, 10. Juli 2018, 16:22:52 CEST schrieb Gustavo A. R. Silva:

Hi Gustavo,

Quoted 2 lines

In case memory resources for *base* were allocated, release them before return.

Thanks a lot.

Ciao
Stephan

#2 lore raw

Hi Stephan,

Quoted 9 lines · Stephan Müller

Am Dienstag, 10. Juli 2018, 16:22:52 CEST schrieb Gustavo A. R. Silva:

Hi Gustavo,

Quoted 2 lines

In case memory resources for *base* were allocated, release them before return.

Thanks a lot.

Glad to help. :)

Quoted 2 lines

Thanks
--
Gustavo

maintainer
#3 lore raw
In reply to Gustavo A. R. Silva
Quoted 6 lines · Gustavo A. R. Silva

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")

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt