diff options
Diffstat (limited to 'crypto')
111 files changed, 203 insertions, 204 deletions
diff --git a/crypto/LPdir_unix.c b/crypto/LPdir_unix.c index bead6abd71..3a14da19b1 100644 --- a/crypto/LPdir_unix.c +++ b/crypto/LPdir_unix.c @@ -78,12 +78,12 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) errno = 0; if (*ctx == NULL) { - *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX)); + *ctx = malloc(sizeof(**ctx)); if (*ctx == NULL) { errno = ENOMEM; return 0; } - memset(*ctx, '\0', sizeof(LP_DIR_CTX)); + memset(*ctx, '\0', sizeof(**ctx)); (*ctx)->dir = opendir(directory); if ((*ctx)->dir == NULL) { diff --git a/crypto/LPdir_vms.c b/crypto/LPdir_vms.c index 88c7ddd85c..1e8f9e7d61 100644 --- a/crypto/LPdir_vms.c +++ b/crypto/LPdir_vms.c @@ -104,12 +104,12 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) return 0; } - *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX)); + *ctx = malloc(sizeof(**ctx)); if (*ctx == NULL) { errno = ENOMEM; return 0; } - memset(*ctx, '\0', sizeof(LP_DIR_CTX)); + memset(*ctx, '\0', sizeof(**ctx)); strcpy((*ctx)->filespec, directory); strcat((*ctx)->filespec, "*.*;"); diff --git a/crypto/LPdir_win.c b/crypto/LPdir_win.c index 07e63fb424..78a796de80 100644 --- a/crypto/LPdir_win.c +++ b/crypto/LPdir_win.c @@ -69,12 +69,12 @@ const char *LP_find_file(LP_DIR_CTX **ctx, const char *directory) return 0; } - *ctx = (LP_DIR_CTX *)malloc(sizeof(LP_DIR_CTX)); + *ctx = malloc(sizeof(**ctx)); if (*ctx == NULL) { errno = ENOMEM; return 0; } - memset(*ctx, '\0', sizeof(LP_DIR_CTX)); + memset(*ctx, '\0', sizeof(**ctx)); if (directory[dirlen - 1] != '*') { extdirbuf = (char *)malloc(dirlen + 3); diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c index 809e9a4112..7cedce82e7 100644 --- a/crypto/asn1/a_object.c +++ b/crypto/asn1/a_object.c @@ -345,7 +345,7 @@ ASN1_OBJECT *ASN1_OBJECT_new(void) { ASN1_OBJECT *ret; - ret = OPENSSL_malloc(sizeof(ASN1_OBJECT)); + ret = OPENSSL_malloc(sizeof(*ret)); if (ret == NULL) { ASN1err(ASN1_F_ASN1_OBJECT_NEW, ERR_R_MALLOC_FAILURE); return (NULL); diff --git a/crypto/asn1/a_strnid.c b/crypto/asn1/a_strnid.c index 5126298673..071613b89b 100644 --- a/crypto/asn1/a_strnid.c +++ b/crypto/asn1/a_strnid.c @@ -240,7 +240,7 @@ static ASN1_STRING_TABLE *stable_get(int nid) tmp = ASN1_STRING_TABLE_get(nid); if (tmp && tmp->flags & STABLE_FLAGS_MALLOC) return tmp; - rv = OPENSSL_malloc(sizeof(ASN1_STRING_TABLE)); + rv = OPENSSL_malloc(sizeof(*rv)); if (!rv) return NULL; if (!sk_ASN1_STRING_TABLE_push(stable, rv)) { diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c index 49f4e5abbf..c7acb468a6 100644 --- a/crypto/asn1/ameth_lib.c +++ b/crypto/asn1/ameth_lib.c @@ -284,7 +284,7 @@ EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags, const char *pem_str, const char *info) { EVP_PKEY_ASN1_METHOD *ameth; - ameth = OPENSSL_malloc(s |