summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/buffer/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/buffer/buffer.c')
-rw-r--r--lib/libcrypto/buffer/buffer.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libcrypto/buffer/buffer.c b/lib/libcrypto/buffer/buffer.c
index e32abb14f35..ddc8f39408e 100644
--- a/lib/libcrypto/buffer/buffer.c
+++ b/lib/libcrypto/buffer/buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.c,v 1.22 2017/01/29 17:49:22 beck Exp $ */
+/* $OpenBSD: buffer.c,v 1.23 2017/03/16 13:15:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -73,14 +73,11 @@ BUF_MEM_new(void)
{
BUF_MEM *ret;
- ret = malloc(sizeof(BUF_MEM));
- if (ret == NULL) {
+ if ((ret = calloc(1, sizeof(BUF_MEM))) == NULL) {
BUFerror(ERR_R_MALLOC_FAILURE);
return (NULL);
}
- ret->length = 0;
- ret->max = 0;
- ret->data = NULL;
+
return (ret);
}