sizeof() updated to cover coding style
authorKirill Marinushkin <k.marinushkin@gmail.com>
Wed, 16 Mar 2016 21:05:59 +0000 (22:05 +0100)
committerRich Salz <rsalz@openssl.org>
Sat, 2 Apr 2016 20:57:07 +0000 (16:57 -0400)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/bio/bss_mem.c

index cc7b6d908edc99bfce6a72721e1372cb3c2c2388..02fa28d7333b77b450b7e6a4ea12135c454f86eb 100644 (file)
@@ -139,13 +139,13 @@ BIO *BIO_new_mem_buf(const void *buf, int len)
 
 static int mem_init(BIO *bi, unsigned long flags)
 {
-    BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(BIO_BUF_MEM));
+    BIO_BUF_MEM *bb = OPENSSL_zalloc(sizeof(*bb));
 
     if (bb == NULL)
         return(0);
     if ((bb->buf = BUF_MEM_new_ex(flags)) == NULL)
         return(0);
-    if ((bb->readp = OPENSSL_zalloc(sizeof(BUF_MEM))) == NULL)
+    if ((bb->readp = OPENSSL_zalloc(sizeof(*bb->readp))) == NULL)
         return(0);
     *bb->readp = *bb->buf;
     bi->shutdown = 1;