[QGIS-trac] [Quantum GIS] #1083: OGR SQL result set leaks due to incorrect call of deallocator

Quantum GIS qgis at qgis.org
Sat May 10 12:27:37 EDT 2008


#1083: OGR SQL result set leaks due to incorrect call of deallocator
------------------------------------------------+---------------------------
   Reporter:  mloskot                           |              Owner:  nobody     
       Type:  defect                            |             Status:  new        
   Priority:  major: does not work as expected  |          Milestone:             
  Component:  OGR Layer support                 |            Version:  HEAD       
   Keywords:  memory release                    |   Platform_version:  Ubuntu 7.04
   Platform:  Linux                             |           Must_fix:  No         
Status_info:  0                                 |  
------------------------------------------------+---------------------------
 In file [source:trunk/qgis/src/providers/ogr/qgsogrprovider.cpp at 8406#L1290
 qgsogrprovider.cpp], line 1290, invalid call of function
 OGR_DS_ReleaseResultSet causes memory leak in GDAL/OGR.

 The function is called with parameters in incorrect order:

 {{{
 OGR_DS_ReleaseResultSet(l, ogrDataSource);
 }}}

 but it should read
 {{{
 OGR_DS_ReleaseResultSet(ogrDataSource, l);
 }}}

 In other words, datasource handle goes first, then layer handle (see
 [http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/generic/ogrdatasource.cpp?rev=14288#L873
 OGR_DS_ReleaseResultSet] prototype).

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/1083>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list