From 404e6e64d063df7a47fd9a5faaaac954d11f5114 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Mon, 3 Nov 2014 17:49:32 -0800 Subject: [PATCH] Small tweak to ec_GFp_simple_points_make_affine. (Imported from upstream's 267e6f3cc0ef78dea4e5cf93907a71556a45f008) Change-Id: I99cfd0196b9625449c50494562c44f57f09fed17 Reviewed-on: https://boringssl-review.googlesource.com/2167 Reviewed-by: David Benjamin Reviewed-by: Adam Langley --- crypto/ec/simple.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crypto/ec/simple.c b/crypto/ec/simple.c index 2c85746c..32089b27 100644 --- a/crypto/ec/simple.c +++ b/crypto/ec/simple.c @@ -1338,9 +1338,10 @@ err: } if (prod_Z != NULL) { for (i = 0; i < num; i++) { - if (prod_Z[i] != NULL) { - BN_clear_free(prod_Z[i]); + if (prod_Z[i] == NULL) { + break; } + BN_clear_free(prod_Z[i]); } OPENSSL_free(prod_Z); }