no need for malloc casts
authorderaadt <deraadt@openbsd.org>
Mon, 21 Apr 2014 16:08:08 +0000 (16:08 +0000)
committerderaadt <deraadt@openbsd.org>
Mon, 21 Apr 2014 16:08:08 +0000 (16:08 +0000)
lib/libcrypto/x509v3/v3_lib.c
lib/libcrypto/x509v3/v3_utl.c
lib/libssl/src/crypto/x509v3/v3_lib.c
lib/libssl/src/crypto/x509v3/v3_utl.c

index 0613ea7..8d5e6ee 100644 (file)
@@ -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;
        }
index d938a17..f85c1ef 100644 (file)
@@ -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;
index 0613ea7..8d5e6ee 100644 (file)
@@ -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;
        }
index d938a17..f85c1ef 100644 (file)
@@ -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;