mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
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
This commit is contained in:
committed by
Manuel Pégourié-Gonnard
parent
fd9afb29d3
commit
c531b4af3c
@ -103,7 +103,7 @@ int ssl_cache_get( void *data, ssl_session *session )
|
||||
*/
|
||||
if( entry->peer_cert.p != NULL )
|
||||
{
|
||||
if( ( session->peer_cert = (x509_crt *) polarssl_malloc(
|
||||
if( ( session->peer_cert = polarssl_malloc(
|
||||
sizeof(x509_crt) ) ) == NULL )
|
||||
{
|
||||
ret = 1;
|
||||
@ -222,7 +222,7 @@ int ssl_cache_set( void *data, const ssl_session *session )
|
||||
/*
|
||||
* max_entries not reached, create new entry
|
||||
*/
|
||||
cur = (ssl_cache_entry *) polarssl_malloc( sizeof(ssl_cache_entry) );
|
||||
cur = polarssl_malloc( sizeof(ssl_cache_entry) );
|
||||
if( cur == NULL )
|
||||
{
|
||||
ret = 1;
|
||||
@ -259,7 +259,7 @@ int ssl_cache_set( void *data, const ssl_session *session )
|
||||
*/
|
||||
if( session->peer_cert != NULL )
|
||||
{
|
||||
cur->peer_cert.p = (unsigned char *) polarssl_malloc(
|
||||
cur->peer_cert.p = polarssl_malloc(
|
||||
session->peer_cert->raw.len );
|
||||
if( cur->peer_cert.p == NULL )
|
||||
{
|
||||
|
Reference in New Issue
Block a user