diff options
Diffstat (limited to 'src/lib/libcrypto/pkcs7/bio_ber.c')
-rw-r--r-- | src/lib/libcrypto/pkcs7/bio_ber.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/libcrypto/pkcs7/bio_ber.c b/src/lib/libcrypto/pkcs7/bio_ber.c index 216d237b4d..fbcbd16abe 100644 --- a/src/lib/libcrypto/pkcs7/bio_ber.c +++ b/src/lib/libcrypto/pkcs7/bio_ber.c | |||
@@ -126,11 +126,9 @@ static int ber_new(BIO *bi) | |||
126 | { | 126 | { |
127 | BIO_BER_CTX *ctx; | 127 | BIO_BER_CTX *ctx; |
128 | 128 | ||
129 | ctx=(BIO_BER_CTX *)malloc(sizeof(BIO_BER_CTX)); | 129 | ctx=calloc(1, sizeof(BIO_BER_CTX)); |
130 | if (ctx == NULL) return(0); | 130 | if (ctx == NULL) return(0); |
131 | 131 | ||
132 | memset((char *)ctx,0,sizeof(BIO_BER_CTX)); | ||
133 | |||
134 | bi->init=0; | 132 | bi->init=0; |
135 | bi->ptr=(char *)ctx; | 133 | bi->ptr=(char *)ctx; |
136 | bi->flags=0; | 134 | bi->flags=0; |