[GRASS-dev] [GRASS GIS] #659: probable memory leak in v.surf.bspline

GRASS GIS trac at osgeo.org
Mon Jun 22 03:21:14 EDT 2009


#659: probable memory leak in v.surf.bspline
----------------------------+-----------------------------------------------
 Reporter:  hamish          |       Owner:  grass-dev at lists.osgeo.org
     Type:  defect          |      Status:  new                      
 Priority:  normal          |   Milestone:  6.4.0                    
Component:  Vector          |     Version:  6.4.0 RCs                
 Keywords:  v.surf.bspline  |    Platform:  All                      
      Cpu:  All             |  
----------------------------+-----------------------------------------------
 Hi,

 source:grass/trunk/vector/lidar/v.surf.bspline/main.c@#L364 has:

 {{{
 nrows = G_window_rows();
 ncols = G_window_cols();

 if (!G_alloc_matrix(nrows, ncols))
     G_fatal_error(_("Interpolation: The region resolution is too high: "
                    "%d cells. Consider to change it."), nrows * ncols);
 }}}

 is that a rather big memory leak? should it be like:

 {{{
 raster_matrix = G_alloc_matrix(nrows, ncols);

 if (!raster_matrix)
     G_fatal_error(...);
 else
     G_free_matrix(raster_matrix);
 }}}

 ?


 Hamish

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/659>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list