diff options
author | tedu <> | 2014-05-25 20:28:50 +0000 |
---|---|---|
committer | tedu <> | 2014-05-25 20:28:50 +0000 |
commit | 896ee758458e7d17dd2014f065480b5085e6be10 (patch) | |
tree | 7a0bda660a181d082657a078f67d9146fbd212c2 /src/lib/libcrypto/pkcs7/bio_ber.c | |
parent | 339be6db68ff6f687a26e3c86aae9664fb3d0187 (diff) | |
download | openbsd-896ee758458e7d17dd2014f065480b5085e6be10.tar.gz openbsd-896ee758458e7d17dd2014f065480b5085e6be10.tar.bz2 openbsd-896ee758458e7d17dd2014f065480b5085e6be10.zip |
calloc instead of malloc/memset. from Benjamin Baier
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; |