[GRASS-dev] Re: [GRASS GIS] #273: v.example leaks memory in db_open_select_cursor

GRASS GIS trac at osgeo.org
Tue Sep 2 20:51:50 EDT 2008


#273: v.example leaks memory in db_open_select_cursor
-----------------------+----------------------------------------------------
  Reporter:  karme     |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect    |      Status:  new                      
  Priority:  major     |   Milestone:  6.4.0                    
 Component:  Database  |     Version:  svn-trunk                
Resolution:            |    Keywords:                           
  Platform:  Linux     |         Cpu:  x86-32                   
-----------------------+----------------------------------------------------
Comment (by glynn):

 Replying to [comment:2 karme]:
 > "proposed patch" is not quite true. I am not really sure - please
 review. Thanks.

 The patch looks reasonable enough, although it's essentially impossible to
 tell whether it will break anything. db_get_string() returns the pointer,
 and if anything holds onto the pointer after db_free_column() returns, it
 will break.

 My inclination is to apply the patch. Unlike most GRASS memory "leaks",
 this one could be significant. I.e. if it leaks memory for each row
 fetched, it would impose a limit on the amount of data retrieved from a
 query.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/273#comment:3>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list