From 6bd740d00a7a8c72fcdff64eae6ee0fa2e8a812b Mon Sep 17 00:00:00 2001 From: miod <> Date: Wed, 9 Jul 2014 16:59:33 +0000 Subject: {malloc,reallocarray} + memset(,0,) -> calloc ok tedu@ --- src/lib/libcrypto/store/str_mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/libcrypto/store/str_mem.c') diff --git a/src/lib/libcrypto/store/str_mem.c b/src/lib/libcrypto/store/str_mem.c index 4eb707c5a9..3f32bcb8d0 100644 --- a/src/lib/libcrypto/store/str_mem.c +++ b/src/lib/libcrypto/store/str_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: str_mem.c,v 1.8 2014/06/12 15:49:30 deraadt Exp $ */ +/* $OpenBSD: str_mem.c,v 1.9 2014/07/09 16:59:33 miod Exp $ */ /* Written by Richard Levitte (richard@levitte.org) for the OpenSSL * project 2003. */ @@ -224,15 +224,15 @@ static void * mem_list_start(STORE *s, STORE_OBJECT_TYPES type, OPENSSL_ITEM attributes[], OPENSSL_ITEM parameters[]) { - struct mem_ctx_st *context = malloc(sizeof(struct mem_ctx_st)); + struct mem_ctx_st *context; void *attribute_context = NULL; STORE_ATTR_INFO *attrs = NULL; + context = calloc(1, sizeof(struct mem_ctx_st)); if (!context) { STOREerr(STORE_F_MEM_LIST_START, ERR_R_MALLOC_FAILURE); return 0; } - memset(context, 0, sizeof(struct mem_ctx_st)); attribute_context = STORE_parse_attrs_start(attributes); if (!attribute_context) { -- cgit v1.2.3-55-g6feb