diff options
| author | Ethan Werner <mail@ethanwerner.com> | 2026-08-09 15:02:21 +0400 |
|---|---|---|
| committer | Ethan Werner <mail@ethanwerner.com> | 2026-08-09 15:02:21 +0400 |
| commit | 3d92926a902017e7cf1f5738e99ff62da596ce12 (patch) | |
| tree | 2b55422c26a48759d56fa91f06df24449e9dfa88 /test/adx.c | |
| parent | 07e18043145f3d91c8ea7ec3ad41b3c905585277 (diff) | |
Diffstat (limited to 'test/adx.c')
| -rw-r--r-- | test/adx.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -13,6 +13,11 @@ bool ts_test_adx( void ) x[1] = malloc( n * sizeof( fp_t ) ); x[2] = malloc( n * sizeof( fp_t ) ); x[3] = malloc( n * sizeof( fp_t ) ); + if ( !x[0 ] || !x[1] || !x[2] || !x[3] ) + { + free( x[0] ); free( x[1] ); free( x[2] ); free( x[3] ); + return false; + } for ( uint_t i = 0; i < n; ++i ) { @@ -36,7 +41,16 @@ bool ts_test_adx( void ) * indices [offset..n-1], not compacted [0..y_n-1] */ fp_t *y[4]; for ( uint_t i = 0; i < 4; ++i ) + { y[i] = calloc( n, sizeof( fp_t ) ); + if ( !y[i] ) + { + for ( uint_t j = 0; j < i; ++j ) + free( y[j] ); + free( x[0] ); free( x[1] ); free( x[2] ); free( x[3] ); + return false; + } + } uint8_t c[TS_CONSTANT_SIZE] = { 0 }; *( uint_t * )c = k; |