summaryrefslogtreecommitdiffstats
path: root/apps/ca.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-04-28 15:28:14 -0400
committerRich Salz <rsalz@openssl.org>2015-04-28 15:28:14 -0400
commitb196e7d936fb377d9c5b305748ac25ff0e53ef6d (patch)
treec855f0808899e5e7ef3a704c35f464ca36014964 /apps/ca.c
parent3e47caff4830d2a117eda15b57a5feab89b846ae (diff)
remove malloc casts
Following ANSI C rules, remove the casts from calls to OPENSSL_malloc and OPENSSL_realloc. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps/ca.c')
-rw-r--r--apps/ca.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 218a407338..ac720dbeea 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1986,17 +1986,17 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
goto end;
/* We now just add it to the database */
- row[DB_type] = (char *)OPENSSL_malloc(2);
+ row[DB_type] = OPENSSL_malloc(2);
tm = X509_get_notAfter(ret);
- row[DB_exp_date] = (char *)OPENSSL_malloc(tm->length + 1);
+ row[DB_exp_date] = OPENSSL_malloc(tm->length + 1);
memcpy(row[DB_exp_date], tm->data, tm->length);
row[DB_exp_date][tm->length] = '\0';
row[DB_rev_date] = NULL;
/* row[DB_serial] done already */
- row[DB_file] = (char *)OPENSSL_malloc(8);
+ row[DB_file] = OPENSSL_malloc(8);
row[DB_name] = X509_NAME_oneline(X509_get_subject_name(ret), NULL, 0);
if ((row[DB_type] == NULL) || (row[DB_exp_date] == NULL) ||
@@ -2008,8 +2008,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
row[DB_type][0] = 'V';
row[DB_type][1] = '\0';
- if ((irow =
- (char **)OPENSSL_malloc(sizeof(char *) * (DB_NUMBER + 1))) == NULL) {
+ if ((irow = OPENSSL_malloc(sizeof(char *) * (DB_NUMBER + 1))) == NULL) {
BIO_printf(bio_err, "Memory allocation failure\n");
goto end;
}
@@ -2242,17 +2241,17 @@ static int do_revoke(X509 *x509, CA_DB *db, int type, char *value)
row[DB_serial], row[DB_name]);
/* We now just add it to the database */
- row[DB_type] = (char *)OPENSSL_malloc(2);
+ row[DB_type] = OPENSSL_malloc(2);
tm = X509_get_notAfter(x509);
- row[DB_exp_date] = (char *)OPENSSL_malloc(tm->length + 1);
+ row[DB_exp_date] = OPENSSL_malloc(tm->length + 1);
memcpy(row[DB_exp_date], tm->data, tm->length);
row[DB_exp_date][tm->length] = '\0';
row[DB_rev_date] = NULL;
/* row[DB_serial] done already */
- row[DB_file] = (char *)OPENSSL_malloc(8);
+ row[DB_file] = OPENSSL_malloc(8);
/* row[DB_name] done already */
@@ -2265,9 +2264,7 @@ static int do_revoke(X509 *x509, CA_DB *db, int type, char *value)
row[DB_type][0] = 'V';
row[DB_type][1] = '\0';
- if ((irow =
- (char **)OPENSSL_malloc(sizeof(char *) * (DB_NUMBER + 1))) ==
- NULL) {
+ if ((irow = OPENSSL_malloc(sizeof(char *) * (DB_NUMBER + 1))) == NULL) {
BIO_printf(bio_err, "Memory allocation failure\n");
goto end;
}
@@ -2406,7 +2403,7 @@ static int do_updatedb(CA_DB *db)
/* get actual time and make a string */
a_tm = X509_gmtime_adj(a_tm, 0);
- a_tm_s = (char *)OPENSSL_malloc(a_tm->length + 1);
+ a_tm_s = OPENSSL_malloc(a_tm->length + 1);
if (a_tm_s == NULL) {
cnt = -1;
goto end;