diff --git a/lib/node_modules/@stdlib/blas/ext/base/dnanasum/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dnanasum/benchmark/c/benchmark.length.c index d524f4d8ebe5..16feac5deb98 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dnanasum/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dnanasum/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -121,6 +122,8 @@ static double benchmark1( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + + free(x); return elapsed; } @@ -133,11 +136,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - double x[ len ]; + double *x; double v; double t; int i; + x = (double *) malloc( len * sizeof( double ) ); for ( i = 0; i < len; i++ ) { if ( rand_double() < 0.2 ) { x[ i ] = 0.0 / 0.0; // NaN @@ -158,6 +162,7 @@ static double benchmark2( int iterations, int len ) { if ( v != v ) { printf( "should not return NaN\n" ); } + free(x); return elapsed; }