Add and use OPENSSL_zalloc
There are many places (nearly 50) where we malloc and then memset. Add an OPENSSL_zalloc routine to encapsulate that. (Missed one conversion; thanks Richard) Also fixes GH328 Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
@@ -91,9 +91,7 @@ static void *zlib_zalloc(void *opaque, unsigned int no, unsigned int size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
p = OPENSSL_malloc(no * size);
|
||||
if (p)
|
||||
memset(p, 0, no * size);
|
||||
p = OPENSSL_zalloc(no * size);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user