summaryrefslogtreecommitdiff
path: root/crypto/ec
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-02-14 18:44:30 +0100
committerRich Salz <rsalz@openssl.org>2016-02-22 12:13:37 -0500
commita2d0baa2d931feae7f820d4594528894fd4a46cb (patch)
treee576be98f17420e99d670380470be080441c6a31 /crypto/ec
parentcbb259caaf2cabf9bedc35fd41ba84f048a3de0f (diff)
downloadopenssl-new-a2d0baa2d931feae7f820d4594528894fd4a46cb.tar.gz
GH678: Add a few more zalloc
Remove some duplicated NULL/zero init. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ecp_nistp256.c6
-rw-r--r--crypto/ec/ecp_nistz256.c2
2 files changed, 3 insertions, 5 deletions
diff --git a/crypto/ec/ecp_nistp256.c b/crypto/ec/ecp_nistp256.c
index d4bff1ad6d..a02af0da3e 100644
--- a/crypto/ec/ecp_nistp256.c
+++ b/crypto/ec/ecp_nistp256.c
@@ -1816,13 +1816,13 @@ const EC_METHOD *EC_GFp_nistp256_method(void)
static NISTP256_PRE_COMP *nistp256_pre_comp_new()
{
- NISTP256_PRE_COMP *ret = NULL;
- ret = OPENSSL_malloc(sizeof(*ret));
+ NISTP256_PRE_COMP *ret = OPENSSL_zalloc(sizeof(*ret));
+
if (ret == NULL) {
ECerr(EC_F_NISTP256_PRE_COMP_NEW, ERR_R_MALLOC_FAILURE);
return ret;
}
- memset(ret->g_pre_comp, 0, sizeof(ret->g_pre_comp));
+
ret->references = 1;
return ret;
}
diff --git a/crypto/ec/ecp_nistz256.c b/crypto/ec/ecp_nistz256.c
index 388e87e0fb..4b95019410 100644
--- a/crypto/ec/ecp_nistz256.c
+++ b/crypto/ec/ecp_nistz256.c
@@ -1395,8 +1395,6 @@ static NISTZ256_PRE_COMP *ecp_nistz256_pre_comp_new(const EC_GROUP *group)
ret->group = group;
ret->w = 6; /* default */
- ret->precomp = NULL;
- ret->precomp_storage = NULL;
ret->references = 1;
return ret;
}