From ec5022a2538bbe827cdf0258da87220b0d83f260 Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 21 Apr 2014 16:08:08 +0000 Subject: [PATCH] no need for malloc casts --- lib/libcrypto/x509v3/v3_lib.c | 2 +- lib/libcrypto/x509v3/v3_utl.c | 2 +- lib/libssl/src/crypto/x509v3/v3_lib.c | 2 +- lib/libssl/src/crypto/x509v3/v3_utl.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libcrypto/x509v3/v3_lib.c b/lib/libcrypto/x509v3/v3_lib.c index 0613ea7f221..8d5e6ee9116 100644 --- a/lib/libcrypto/x509v3/v3_lib.c +++ b/lib/libcrypto/x509v3/v3_lib.c @@ -133,7 +133,7 @@ int X509V3_EXT_add_alias(int nid_to, int nid_from) X509V3err(X509V3_F_X509V3_EXT_ADD_ALIAS,X509V3_R_EXTENSION_NOT_FOUND); return 0; } - if(!(tmpext = (X509V3_EXT_METHOD *)malloc(sizeof(X509V3_EXT_METHOD)))) { + if(!(tmpext = malloc(sizeof(X509V3_EXT_METHOD)))) { X509V3err(X509V3_F_X509V3_EXT_ADD_ALIAS,ERR_R_MALLOC_FAILURE); return 0; } diff --git a/lib/libcrypto/x509v3/v3_utl.c b/lib/libcrypto/x509v3/v3_utl.c index d938a175ed6..f85c1ef82ec 100644 --- a/lib/libcrypto/x509v3/v3_utl.c +++ b/lib/libcrypto/x509v3/v3_utl.c @@ -85,7 +85,7 @@ int X509V3_add_value(const char *name, const char *value, char *tname = NULL, *tvalue = NULL; if(name && !(tname = BUF_strdup(name))) goto err; if(value && !(tvalue = BUF_strdup(value))) goto err; - if(!(vtmp = (CONF_VALUE *)malloc(sizeof(CONF_VALUE)))) goto err; + if(!(vtmp = malloc(sizeof(CONF_VALUE)))) goto err; if(!*extlist && !(*extlist = sk_CONF_VALUE_new_null())) goto err; vtmp->section = NULL; vtmp->name = tname; diff --git a/lib/libssl/src/crypto/x509v3/v3_lib.c b/lib/libssl/src/crypto/x509v3/v3_lib.c index 0613ea7f221..8d5e6ee9116 100644 --- a/lib/libssl/src/crypto/x509v3/v3_lib.c +++ b/lib/libssl/src/crypto/x509v3/v3_lib.c @@ -133,7 +133,7 @@ int X509V3_EXT_add_alias(int nid_to, int nid_from) X509V3err(X509V3_F_X509V3_EXT_ADD_ALIAS,X509V3_R_EXTENSION_NOT_FOUND); return 0; } - if(!(tmpext = (X509V3_EXT_METHOD *)malloc(sizeof(X509V3_EXT_METHOD)))) { + if(!(tmpext = malloc(sizeof(X509V3_EXT_METHOD)))) { X509V3err(X509V3_F_X509V3_EXT_ADD_ALIAS,ERR_R_MALLOC_FAILURE); return 0; } diff --git a/lib/libssl/src/crypto/x509v3/v3_utl.c b/lib/libssl/src/crypto/x509v3/v3_utl.c index d938a175ed6..f85c1ef82ec 100644 --- a/lib/libssl/src/crypto/x509v3/v3_utl.c +++ b/lib/libssl/src/crypto/x509v3/v3_utl.c @@ -85,7 +85,7 @@ int X509V3_add_value(const char *name, const char *value, char *tname = NULL, *tvalue = NULL; if(name && !(tname = BUF_strdup(name))) goto err; if(value && !(tvalue = BUF_strdup(value))) goto err; - if(!(vtmp = (CONF_VALUE *)malloc(sizeof(CONF_VALUE)))) goto err; + if(!(vtmp = malloc(sizeof(CONF_VALUE)))) goto err; if(!*extlist && !(*extlist = sk_CONF_VALUE_new_null())) goto err; vtmp->section = NULL; vtmp->name = tname; -- 2.20.1