]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
More zalloc nits
authorRich Salz <rsalz@akamai.com>
Fri, 4 Sep 2015 12:13:19 +0000 (08:13 -0400)
committerRich Salz <rsalz@openssl.org>
Fri, 4 Sep 2015 15:45:44 +0000 (11:45 -0400)
Found on GitHub by dimman

Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/evp/pmeth_lib.c
crypto/stack/stack.c

index a2d8382de32b0a3ac7135a76275cb4fcdedd1037..cff3dd245abf0577fbdd6437ff6c3d32b1b94cb6 100644 (file)
@@ -180,7 +180,6 @@ static EVP_PKEY_CTX *int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id)
     ret->pkey = pkey;
     if (pkey)
         CRYPTO_add(&pkey->references, 1, CRYPTO_LOCK_EVP_PKEY);
-    ret->data = NULL;
 
     if (pmeth->init) {
         if (pmeth->init(ret) <= 0) {
index e9d80a72dbfb7dd9424b426e2b01de3657084d88..9d2d4f4658c6ee3314f8ce6b41a6b01c7c3a09bc 100644 (file)
@@ -153,7 +153,7 @@ _STACK *sk_new(int (*c) (const void *, const void *))
 
     if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == NULL)
         goto err;
-    if ((ret->data = OPENSSL_malloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
+    if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * MIN_NODES)) == NULL)
         goto err;
     ret->comp = c;
     ret->num_alloc = MIN_NODES;