From a99a5440eb2cc4975dfdc99d893f7bfe68716c52 Mon Sep 17 00:00:00 2001 From: inoguchi Date: Wed, 5 Jan 2022 10:33:36 +0000 Subject: [PATCH] Use calloc instead of malloc suggested by tb@ --- usr.bin/openssl/cms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/openssl/cms.c b/usr.bin/openssl/cms.c index 212ed2a9c7a..58fcb4b6567 100644 --- a/usr.bin/openssl/cms.c +++ b/usr.bin/openssl/cms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cms.c,v 1.20 2022/01/05 10:29:08 inoguchi Exp $ */ +/* $OpenBSD: cms.c,v 1.21 2022/01/05 10:33:36 inoguchi Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -273,7 +273,7 @@ cms_opt_keyopt(char *arg) cms_config.key_param->idx != keyidx) { struct cms_key_param *nparam; - if ((nparam = malloc(sizeof(struct cms_key_param))) == NULL) + if ((nparam = calloc(1, sizeof(struct cms_key_param))) == NULL) return (1); nparam->idx = keyidx; -- 2.20.1