diff options
-rw-r--r-- | src/lib/libcrypto/dso/dso_lib.c | 3 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/dso/dso_lib.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libcrypto/dso/dso_lib.c b/src/lib/libcrypto/dso/dso_lib.c index 1ee4e45dce..ae10104560 100644 --- a/src/lib/libcrypto/dso/dso_lib.c +++ b/src/lib/libcrypto/dso/dso_lib.c | |||
@@ -107,12 +107,11 @@ DSO_new_method(DSO_METHOD *meth) | |||
107 | * to stealing the "best available" method. Will fallback | 107 | * to stealing the "best available" method. Will fallback |
108 | * to DSO_METH_null() in the worst case. */ | 108 | * to DSO_METH_null() in the worst case. */ |
109 | default_DSO_meth = DSO_METHOD_openssl(); | 109 | default_DSO_meth = DSO_METHOD_openssl(); |
110 | ret = (DSO *)malloc(sizeof(DSO)); | 110 | ret = calloc(1, sizeof(DSO)); |
111 | if (ret == NULL) { | 111 | if (ret == NULL) { |
112 | DSOerr(DSO_F_DSO_NEW_METHOD, ERR_R_MALLOC_FAILURE); | 112 | DSOerr(DSO_F_DSO_NEW_METHOD, ERR_R_MALLOC_FAILURE); |
113 | return (NULL); | 113 | return (NULL); |
114 | } | 114 | } |
115 | memset(ret, 0, sizeof(DSO)); | ||
116 | ret->meth_data = sk_void_new_null(); | 115 | ret->meth_data = sk_void_new_null(); |
117 | if (ret->meth_data == NULL) { | 116 | if (ret->meth_data == NULL) { |
118 | /* sk_new doesn't generate any errors so we do */ | 117 | /* sk_new doesn't generate any errors so we do */ |
diff --git a/src/lib/libssl/src/crypto/dso/dso_lib.c b/src/lib/libssl/src/crypto/dso/dso_lib.c index 1ee4e45dce..ae10104560 100644 --- a/src/lib/libssl/src/crypto/dso/dso_lib.c +++ b/src/lib/libssl/src/crypto/dso/dso_lib.c | |||
@@ -107,12 +107,11 @@ DSO_new_method(DSO_METHOD *meth) | |||
107 | * to stealing the "best available" method. Will fallback | 107 | * to stealing the "best available" method. Will fallback |
108 | * to DSO_METH_null() in the worst case. */ | 108 | * to DSO_METH_null() in the worst case. */ |
109 | default_DSO_meth = DSO_METHOD_openssl(); | 109 | default_DSO_meth = DSO_METHOD_openssl(); |
110 | ret = (DSO *)malloc(sizeof(DSO)); | 110 | ret = calloc(1, sizeof(DSO)); |
111 | if (ret == NULL) { | 111 | if (ret == NULL) { |
112 | DSOerr(DSO_F_DSO_NEW_METHOD, ERR_R_MALLOC_FAILURE); | 112 | DSOerr(DSO_F_DSO_NEW_METHOD, ERR_R_MALLOC_FAILURE); |
113 | return (NULL); | 113 | return (NULL); |
114 | } | 114 | } |
115 | memset(ret, 0, sizeof(DSO)); | ||
116 | ret->meth_data = sk_void_new_null(); | 115 | ret->meth_data = sk_void_new_null(); |
117 | if (ret->meth_data == NULL) { | 116 | if (ret->meth_data == NULL) { |
118 | /* sk_new doesn't generate any errors so we do */ | 117 | /* sk_new doesn't generate any errors so we do */ |