Commit d6d6e8fc authored by Ben Boeckel's avatar Ben Boeckel

TestIncrementalOctreePointLocator: use malloc

These variables are set to NULL at the top of the file and not set in
between there and the realloc usage, so just use malloc instead.

Change-Id: I537456035ddd68e939cf15e1d712da3acc9c76d3
parent 79abddf1
......@@ -457,9 +457,9 @@ int TestIncrementalOctreePointLocator( int argc, char * argv[] )
SwapForBigEndian
( ( unsigned char * ) ( &nLocPnts ), sizeof( int ), 1 );
#endif
pLocPnts = ( double * ) realloc( pLocPnts, sizeof( double ) * nLocPnts * 3 );
minDist2 = ( double * ) realloc( minDist2, sizeof( double ) * nLocPnts );
maxDist2 = ( double * ) realloc( maxDist2, sizeof( double ) * nLocPnts );
pLocPnts = ( double * ) malloc( sizeof( double ) * nLocPnts * 3 );
minDist2 = ( double * ) malloc( sizeof( double ) * nLocPnts );
maxDist2 = ( double * ) malloc( sizeof( double ) * nLocPnts );
n = fread( pLocPnts, sizeof( double ), nLocPnts * 3, pntsFile );
if (n != static_cast<size_t>(nLocPnts * 3))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment