mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-25 18:41:08 +00:00
Split assert() with side effects in test suite helper
This commit is contained in:
parent
6c343d7d9a
commit
4d0cfe80ea
|
@ -113,7 +113,8 @@ static unsigned char *zero_alloc( size_t len )
|
||||||
void *p;
|
void *p;
|
||||||
size_t actual_len = len != 0 ? len : 1;
|
size_t actual_len = len != 0 ? len : 1;
|
||||||
|
|
||||||
assert( ( p = polarssl_malloc( actual_len ) ) != NULL );
|
p = polarssl_malloc( actual_len );
|
||||||
|
assert( p != NULL );
|
||||||
|
|
||||||
memset( p, 0x00, actual_len );
|
memset( p, 0x00, actual_len );
|
||||||
|
|
||||||
|
@ -139,7 +140,8 @@ static unsigned char *unhexify_alloc( const char *ibuf, size_t *olen )
|
||||||
if( *olen == 0 )
|
if( *olen == 0 )
|
||||||
return( zero_alloc( *olen ) );
|
return( zero_alloc( *olen ) );
|
||||||
|
|
||||||
assert( ( obuf = polarssl_malloc( *olen ) ) != NULL );
|
obuf = polarssl_malloc( *olen );
|
||||||
|
assert( obuf != NULL );
|
||||||
|
|
||||||
(void) unhexify( obuf, ibuf );
|
(void) unhexify( obuf, ibuf );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue