diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-02-14 18:44:30 +0100 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-02-22 18:13:37 +0100 |
commit | a2d0baa2d931feae7f820d4594528894fd4a46cb (patch) | |
tree | e576be98f17420e99d670380470be080441c6a31 /crypto/ec/ecp_nistp256.c | |
parent | RT4334: Check UEFI before __STDC_VERSION__ for <inttypes.h> (diff) | |
download | openssl-a2d0baa2d931feae7f820d4594528894fd4a46cb.tar.xz openssl-a2d0baa2d931feae7f820d4594528894fd4a46cb.zip |
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.c | 6 |
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; } |