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/cipher_wrap.c b/library/cipher_wrap.c
index 736c292..c958cf6 100644
--- a/library/cipher_wrap.c
+++ b/library/cipher_wrap.c
@@ -182,7 +182,7 @@
static void * aes_ctx_alloc( void )
{
- aes_context *aes = (aes_context *) polarssl_malloc( sizeof( aes_context ) );
+ aes_context *aes = polarssl_malloc( sizeof( aes_context ) );
if( aes == NULL )
return( NULL );
@@ -544,7 +544,7 @@
static void * camellia_ctx_alloc( void )
{
camellia_context *ctx;
- ctx = (camellia_context *) polarssl_malloc( sizeof( camellia_context ) );
+ ctx = polarssl_malloc( sizeof( camellia_context ) );
if( ctx == NULL )
return( NULL );
@@ -925,7 +925,7 @@
static void * des_ctx_alloc( void )
{
- des_context *des = (des_context *) polarssl_malloc( sizeof( des_context ) );
+ des_context *des = polarssl_malloc( sizeof( des_context ) );
if( des == NULL )
return( NULL );
@@ -944,7 +944,7 @@
static void * des3_ctx_alloc( void )
{
des3_context *des3;
- des3 = (des3_context *) polarssl_malloc( sizeof( des3_context ) );
+ des3 = polarssl_malloc( sizeof( des3_context ) );
if( des3 == NULL )
return( NULL );
@@ -1148,7 +1148,7 @@
static void * blowfish_ctx_alloc( void )
{
blowfish_context *ctx;
- ctx = (blowfish_context *) polarssl_malloc( sizeof( blowfish_context ) );
+ ctx = polarssl_malloc( sizeof( blowfish_context ) );
if( ctx == NULL )
return( NULL );
@@ -1250,7 +1250,7 @@
static void * arc4_ctx_alloc( void )
{
arc4_context *ctx;
- ctx = (arc4_context *) polarssl_malloc( sizeof( arc4_context ) );
+ ctx = polarssl_malloc( sizeof( arc4_context ) );
if( ctx == NULL )
return( NULL );