Changeset 14122

Show
Ignore:
Timestamp:
03/30/08 06:33:39 (3 months ago)
Author:
rouault
Message:

thinplatespline : memory allocated with 'calloc' freed with 'delete' (#2301)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gdal/alg/thinplatespline.cpp

    r14117 r14122  
    277277    // Make the necessary memory allocations 
    278278    if ( _AA ) 
    279         delete _AA
     279        CPLFree(_AA)
    280280    if ( _Ainv ) 
    281         delete _Ainv
     281        CPLFree(_Ainv)
    282282         
    283283    _nof_eqs = _nof_points + 3; 
    284284         
    285     _AA = ( double * )calloc( _nof_eqs * _nof_eqs, sizeof( double ) ); 
    286     _Ainv = ( double * )calloc( _nof_eqs * _nof_eqs, sizeof( double ) ); 
     285    _AA = ( double * )CPLCalloc( _nof_eqs * _nof_eqs, sizeof( double ) ); 
     286    _Ainv = ( double * )CPLCalloc( _nof_eqs * _nof_eqs, sizeof( double ) ); 
    287287         
    288288    // Calc the values of the matrix A 
  • trunk/gdal/alg/thinplatespline.h

    r10645 r14122  
    7979    ~VizGeorefSpline2D(){ 
    8080        if ( _AA ) 
    81             delete _AA
     81            CPLFree(_AA)
    8282        if ( _Ainv ) 
    83             delete _Ainv
     83            CPLFree(_Ainv)
    8484 
    8585        CPLFree( x ); 
     
    129129            if ( _AA ) 
    130130            { 
    131                 delete _AA
     131                CPLFree(_AA)
    132132                _AA = NULL; 
    133133            } 
    134134            if ( _Ainv ) 
    135135            { 
    136                 delete _Ainv
     136                CPLFree(_Ainv)
    137137                _Ainv = NULL; 
    138138            }