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>
This commit is contained in:
Rich Salz
2015-09-03 09:15:26 -04:00
committed by Rich Salz
parent fb4844bbc6
commit 64b25758ed
47 changed files with 78 additions and 469 deletions

View File

@@ -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);