Apply the semantic patch rm-malloc-cast.cocci.
for dir in library programs; do
spatch --sp-file scripts/rm-malloc-cast.cocci --dir $dir \
--in-place;
done
diff --git a/library/bignum.c b/library/bignum.c
index 0eb95ee..df519fa 100644
--- a/library/bignum.c
+++ b/library/bignum.c
@@ -107,7 +107,7 @@
if( X->n < nblimbs )
{
- if( ( p = (t_uint *) polarssl_malloc( nblimbs * ciL ) ) == NULL )
+ if( ( p = polarssl_malloc( nblimbs * ciL ) ) == NULL )
return( POLARSSL_ERR_MPI_MALLOC_FAILED );
memset( p, 0, nblimbs * ciL );
@@ -147,7 +147,7 @@
if( i < nblimbs )
i = nblimbs;
- if( ( p = (t_uint *) polarssl_malloc( i * ciL ) ) == NULL )
+ if( ( p = polarssl_malloc( i * ciL ) ) == NULL )
return( POLARSSL_ERR_MPI_MALLOC_FAILED );
memset( p, 0, i * ciL );