From 66415b639e41b19badb8ea5e4b48aa9f294bf48b Mon Sep 17 00:00:00 2001 From: tedu Date: Sun, 25 May 2014 20:28:50 +0000 Subject: calloc instead of malloc/memset. from Benjamin Baier --- lib/libcrypto/comp/comp_lib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/libcrypto/comp/comp_lib.c') diff --git a/lib/libcrypto/comp/comp_lib.c b/lib/libcrypto/comp/comp_lib.c index 745c8022281..64d19df6635 100644 --- a/lib/libcrypto/comp/comp_lib.c +++ b/lib/libcrypto/comp/comp_lib.c @@ -9,11 +9,10 @@ COMP_CTX_new(COMP_METHOD *meth) { COMP_CTX *ret; - if ((ret = (COMP_CTX *)malloc(sizeof(COMP_CTX))) == NULL) { + if ((ret = calloc(1, sizeof(COMP_CTX))) == NULL) { /* ZZZZZZZZZZZZZZZZ */ return (NULL); } - memset(ret, 0, sizeof(COMP_CTX)); ret->meth = meth; if ((ret->meth->init != NULL) && !ret->meth->init(ret)) { free(ret); -- cgit v1.2.3-59-g8ed1b