Don't cast {m,re}alloc.  No point and it's inconsistent already.

Index: apps.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/apps/apps.c,v
retrieving revision 1.42
diff -u -p -r1.42 apps.c
--- apps.c      22 Apr 2014 14:54:13 -0000      1.42
+++ apps.c      23 Apr 2014 07:20:29 -0000
@@ -216,7 +216,7 @@ chopup_args(ARGS * arg, char *buf, int *
        i = 0;
        if (arg->count == 0) {
                arg->count = 20;
-               arg->data = (char **)malloc(sizeof(char *) * arg->count);
+               arg->data = malloc(sizeof(char *) * arg->count);
        }
        for (i = 0; i < arg->count; i++)
                arg->data[i] = NULL;
@@ -236,8 +236,7 @@ chopup_args(ARGS * arg, char *buf, int *
                if (num >= arg->count) {
                        char **tmp_p;
                        int tlen = arg->count + 20;
-                       tmp_p = (char **) realloc(arg->data,
-                           sizeof(char *) * tlen);
+                       tmp_p = realloc(arg->data, sizeof(char *) * tlen);
                        if (tmp_p == NULL)
                                return 0;
                        arg->data = tmp_p;
@@ -417,7 +416,7 @@ password_callback(char *buf, int bufsiz,
                        ok = UI_add_input_string(ui, prompt, ui_flags, buf,
                            PW_MIN_LENGTH, bufsiz - 1);
                if (ok >= 0 && verify) {
-                       buff = (char *) malloc(bufsiz);
+                       buff = malloc(bufsiz);
                        ok = UI_add_verify_string(ui, prompt, ui_flags, buff,
                            PW_MIN_LENGTH, bufsiz - 1, buf);
                }
Index: ca.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/apps/ca.c,v
retrieving revision 1.46
diff -u -p -r1.46 ca.c
--- ca.c        22 Apr 2014 13:32:17 -0000      1.46
+++ ca.c        23 Apr 2014 07:20:29 -0000
@@ -1981,17 +1981,17 @@ again2:
                goto err;
 
        /* We now just add it to the database */
-       row[DB_type] = (char *) malloc(2);
+       row[DB_type] = malloc(2);
 
        tm = X509_get_notAfter(ret);
-       row[DB_exp_date] = (char *) malloc(tm->length + 1);
+       row[DB_exp_date] = 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 *) malloc(8);
+       row[DB_file] = 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) ||
@@ -2003,8 +2003,7 @@ again2:
        row[DB_type][0] = 'V';
        row[DB_type][1] = '\0';
 
-       if ((irow = (char **)malloc(sizeof(char *) * (DB_NUMBER + 1))) ==
-           NULL) {
+       if ((irow = malloc(sizeof(char *) * (DB_NUMBER + 1))) == NULL) {
                BIO_printf(bio_err, "Memory allocation failure\n");
                goto err;
        }
@@ -2245,17 +2244,17 @@ do_revoke(X509 * x509, CA_DB * db, int t
                    row[DB_serial], row[DB_name]);
 
                /* We now just add it to the database */
-               row[DB_type] = (char *) malloc(2);
+               row[DB_type] = malloc(2);
 
                tm = X509_get_notAfter(x509);
-               row[DB_exp_date] = (char *) malloc(tm->length + 1);
+               row[DB_exp_date] = 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 *) malloc(8);
+               row[DB_file] = malloc(8);
 
                /* row[DB_name] done already */
 
@@ -2268,7 +2267,7 @@ do_revoke(X509 * x509, CA_DB * db, int t
                row[DB_type][0] = 'V';
                row[DB_type][1] = '\0';
 
-               if ((irow = (char **)malloc(sizeof(char *) *
+               if ((irow = malloc(sizeof(char *) *
                    (DB_NUMBER + 1))) == NULL) {
                        BIO_printf(bio_err, "Memory allocation failure\n");
                        goto err;
@@ -2405,7 +2404,7 @@ do_updatedb(CA_DB * db)
 
        /* get actual time and make a string */
        a_tm = X509_gmtime_adj(a_tm, 0);
-       a_tm_s = (char *) malloc(a_tm->length + 1);
+       a_tm_s = malloc(a_tm->length + 1);
        if (a_tm_s == NULL) {
                cnt = -1;
                goto err;
Index: dgst.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/apps/dgst.c,v
retrieving revision 1.27
diff -u -p -r1.27 dgst.c
--- dgst.c      18 Apr 2014 19:54:57 -0000      1.27
+++ dgst.c      23 Apr 2014 07:20:30 -0000
@@ -132,7 +132,7 @@ dgst_main(int argc, char **argv)
 
        apps_startup();
 
-       if ((buf = (unsigned char *) malloc(BUFSIZE)) == NULL) {
+       if ((buf = malloc(BUFSIZE)) == NULL) {
                BIO_printf(bio_err, "out of memory\n");
                goto end;
        }
Index: dh.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/apps/dh.c,v
retrieving revision 1.16
diff -u -p -r1.16 dh.c
--- dh.c        18 Apr 2014 04:17:16 -0000      1.16
+++ dh.c        23 Apr 2014 07:20:30 -0000
@@ -251,7 +251,7 @@ bad:
 
                len = BN_num_bytes(dh->p);
                bits = BN_num_bits(dh->p);
-               data = (unsigned char *) malloc(len);
+               data = malloc(len);
                if (data == NULL) {
                        perror("malloc");
                        goto end;
Index: dhparam.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/apps/dhparam.c,v
retrieving revision 1.21
diff -u -p -r1.21 dhparam.c
--- dhparam.c   18 Apr 2014 19:54:57 -0000      1.21
+++ dhparam.c   23 Apr 2014 07:20:30 -0000
@@ -410,7 +410,7 @@ bad:
 
                len = BN_num_bytes(dh->p);
                bits = BN_num_bits(dh->p);
-               data = (unsigned char *) malloc(len);
+               data = malloc(len);
                if (data == NULL) {
                        perror("malloc");
                        goto end;
Index: dsaparam.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/apps/dsaparam.c,v
retrieving revision 1.19
diff -u -p -r1.19 dsaparam.c
--- dsaparam.c  18 Apr 2014 19:54:57 -0000      1.19
+++ dsaparam.c  23 Apr 2014 07:20:30 -0000
@@ -307,7 +307,7 @@ bad:
 
                len = BN_num_bytes(dsa->p);
                bits_p = BN_num_bits(dsa->p);
-               data = (unsigned char *) malloc(len + 20);
+               data = malloc(len + 20);
                if (data == NULL) {
                        perror("malloc");
                        goto end;
Index: ecparam.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/apps/ecparam.c,v
retrieving revision 1.8
diff -u -p -r1.8 ecparam.c
--- ecparam.c   18 Apr 2014 19:58:42 -0000      1.8
+++ ecparam.c   23 Apr 2014 07:20:30 -0000
@@ -465,7 +465,7 @@ bad:
                if ((tmp_len = (size_t) BN_num_bytes(ec_cofactor)) > buf_len)
                        buf_len = tmp_len;
 
-               buffer = (unsigned char *) malloc(buf_len);
+               buffer = malloc(buf_len);
 
                if (buffer == NULL) {
                        perror("malloc");
Index: rsa.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/apps/rsa.c,v
retrieving revision 1.15
diff -u -p -r1.15 rsa.c
--- rsa.c       18 Apr 2014 04:17:17 -0000      1.15
+++ rsa.c       23 Apr 2014 07:20:30 -0000
@@ -349,7 +349,7 @@ bad:
 
                i = 1;
                size = i2d_RSA_NET(rsa, NULL, NULL, sgckey);
-               if ((p = (unsigned char *) malloc(size)) == NULL) {
+               if ((p = malloc(size)) == NULL) {
                        BIO_printf(bio_err, "Memory allocation failure\n");
                        goto end;
                }
Index: s_client.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/apps/s_client.c,v
retrieving revision 1.46
diff -u -p -r1.46 s_client.c
--- s_client.c  22 Apr 2014 14:54:13 -0000      1.46
+++ s_client.c  23 Apr 2014 07:20:30 -0000
@@ -474,7 +474,7 @@ static char *
 ssl_give_srp_client_pwd_cb(SSL * s, void *arg)
 {
        SRP_ARG *srp_arg = (SRP_ARG *) arg;
-       char *pass = (char *) malloc(PWD_STRLEN + 1);
+       char *pass = malloc(PWD_STRLEN + 1);
        PW_CB_DATA cb_tmp;
        int l;
 
Index: speed.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/apps/speed.c,v
retrieving revision 1.34
diff -u -p -r1.34 speed.c
--- speed.c     22 Apr 2014 14:54:13 -0000      1.34
+++ speed.c     23 Apr 2014 07:20:30 -0000
@@ -587,11 +587,11 @@ speed_main(int argc, char **argv)
                rsa_key[i] = NULL;
 #endif
 
-       if ((buf = (unsigned char *) malloc((int) BUFSIZE)) == NULL) {
+       if ((buf = malloc((int) BUFSIZE)) == NULL) {
                BIO_printf(bio_err, "out of memory\n");
                goto end;
        }
-       if ((buf2 = (unsigned char *) malloc((int) BUFSIZE)) == NULL) {
+       if ((buf2 = malloc((int) BUFSIZE)) == NULL) {
                BIO_printf(bio_err, "out of memory\n");
                goto end;
        }
Index: srp.c
===================================================================
RCS file: /cvs/src/lib/libssl/src/apps/srp.c,v
retrieving revision 1.9
diff -u -p -r1.9 srp.c
--- srp.c       18 Apr 2014 19:54:57 -0000      1.9
+++ srp.c       23 Apr 2014 07:20:30 -0000
@@ -176,7 +176,7 @@ update_index(CA_DB * db, BIO * bio, char
        char **irow;
        int i;
 
-       if ((irow = (char **) malloc(sizeof(char *) * (DB_NUMBER + 1))) == 
NULL) {
+       if ((irow = malloc(sizeof(char *) * (DB_NUMBER + 1))) == NULL) {
                BIO_printf(bio_err, "Memory allocation failure\n");
                return 0;
        }

Reply via email to