summaryrefslogtreecommitdiffstats
path: root/crypto/stack
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-09-03 15:15:26 +0200
committerRich Salz <rsalz@openssl.org>2015-09-03 22:26:34 +0200
commit64b25758edca688a30f02c260262150f7ad0bc7d (patch)
tree15ad5a8c7985e2b27aaf7a14737fd980a36349dd /crypto/stack
parentAdd UEFI flag for rand build (diff)
downloadopenssl-64b25758edca688a30f02c260262150f7ad0bc7d.tar.xz
openssl-64b25758edca688a30f02c260262150f7ad0bc7d.zip
remove 0 assignments.
After openssl_zalloc, cleanup more "set to 0/NULL" assignments. Many are from github feedback. Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/stack')
-rw-r--r--crypto/stack/stack.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/crypto/stack/stack.c b/crypto/stack/stack.c
index c7643dbef5..e9d80a72db 100644
--- a/crypto/stack/stack.c
+++ b/crypto/stack/stack.c
@@ -150,19 +150,15 @@ _STACK *sk_new_null(void)
_STACK *sk_new(int (*c) (const void *, const void *))
{
_STACK *ret;
- int i;
- if ((ret = OPENSSL_malloc(sizeof(_STACK))) == NULL)
+ if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
goto err;
if ((ret->data = OPENSSL_malloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
goto err;
- for (i = 0; i < MIN_NODES; i++)
- ret->data[i] = NULL;
ret->comp = c;
ret->num_alloc = MIN_NODES;
- ret->num = 0;
- ret->sorted = 0;
return (ret);
+
err:
OPENSSL_free(ret);
return (NULL);