[postgis-tickets] [PostGIS] #2969: memory leak in the function of "lwtriangle_from_wkb_state"

PostGIS trac at osgeo.org
Tue Oct 21 20:15:15 PDT 2014


#2969: memory leak in the function of "lwtriangle_from_wkb_state"
-------------------------+--------------------------------------------------
 Reporter:  cminus       |       Owner:  pramsey      
     Type:  defect       |      Status:  new          
 Priority:  medium       |   Milestone:  PostGIS 2.1.5
Component:  liblwgeom    |     Version:  trunk        
 Keywords:  memory leak  |  
-------------------------+--------------------------------------------------
 We have detected a memory leak at line 517 of the file
 "liblwgeom\lwin_wkb.c", trunk version.
 The "lwtriangle_construct_empty" function had allocated a POINTERARRAY
 structure for
 tri->points member, but at line 555, that member was override by another
 POINTERARRAY variable 'pa',
 which caused a tiny memory leak.

 Therefore before assigned variable 'pa' , tri->points should be freed
 firstly. e.g.

 if (tri->points)
 {
     ptarray_free(tri->points);
 }

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2969>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list