diff options
| author | tedu <> | 2014-05-25 20:28:50 +0000 |
|---|---|---|
| committer | tedu <> | 2014-05-25 20:28:50 +0000 |
| commit | 7ac48fead6b52013328f67c97481309ffa1e7b59 (patch) | |
| tree | 7a0bda660a181d082657a078f67d9146fbd212c2 /src/lib/libcrypto/x509/x509_vfy.c | |
| parent | 8940e52b42d901dc8efea2d945fccb8954f11458 (diff) | |
| download | openbsd-7ac48fead6b52013328f67c97481309ffa1e7b59.tar.gz openbsd-7ac48fead6b52013328f67c97481309ffa1e7b59.tar.bz2 openbsd-7ac48fead6b52013328f67c97481309ffa1e7b59.zip | |
calloc instead of malloc/memset. from Benjamin Baier
Diffstat (limited to 'src/lib/libcrypto/x509/x509_vfy.c')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index 0024904c20..7da415f27c 100644 --- a/src/lib/libcrypto/x509/x509_vfy.c +++ b/src/lib/libcrypto/x509/x509_vfy.c | |||
| @@ -1950,12 +1950,11 @@ X509_STORE_CTX_new(void) | |||
| 1950 | { | 1950 | { |
| 1951 | X509_STORE_CTX *ctx; | 1951 | X509_STORE_CTX *ctx; |
| 1952 | 1952 | ||
| 1953 | ctx = (X509_STORE_CTX *)malloc(sizeof(X509_STORE_CTX)); | 1953 | ctx = calloc(1, sizeof(X509_STORE_CTX)); |
| 1954 | if (!ctx) { | 1954 | if (!ctx) { |
| 1955 | X509err(X509_F_X509_STORE_CTX_NEW, ERR_R_MALLOC_FAILURE); | 1955 | X509err(X509_F_X509_STORE_CTX_NEW, ERR_R_MALLOC_FAILURE); |
| 1956 | return NULL; | 1956 | return NULL; |
| 1957 | } | 1957 | } |
| 1958 | memset(ctx, 0, sizeof(X509_STORE_CTX)); | ||
| 1959 | return ctx; | 1958 | return ctx; |
| 1960 | } | 1959 | } |
| 1961 | 1960 | ||
