summaryrefslogtreecommitdiff
path: root/crypto/ec/ecp_nistp256.c
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/ecp_nistp256.c
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/ecp_nistp256.c')
-rw-r--r--crypto/ec/ecp_nistp256.c6
1 files changed, 3 insertions, 3 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;
}