]> granicus.if.org Git - postgis/commitdiff
Remove a double-free bug caused if the unparser finds an invalid geometry (fixes...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Sat, 9 May 2009 12:34:55 +0000 (12:34 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Sat, 9 May 2009 12:34:55 +0000 (12:34 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4078 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgunparse.c

index 6690a5bb7381ea6ba269dadd55e3a2f8940d9ece..4bab340c538ad6bf7e08daf0cc0fad9de41f3034 100644 (file)
@@ -357,8 +357,6 @@ output_polygon_ring_collection(uchar* geom,outfunc func,int supress)
              (first_point[0] != last_point[0] || first_point[1] != last_point[1] ) &&
                         (current_unparser_check_flags & PARSER_CHECK_CLOSURE))
                        {
-                       lwfree(first_point);
-                       lwfree(last_point);
                        LWGEOM_WKT_UNPARSER_ERROR(UNPARSER_ERROR_UNCLOSED);     
                        }
 
@@ -366,8 +364,6 @@ output_polygon_ring_collection(uchar* geom,outfunc func,int supress)
                /* Ensure that POLYGON has a minimum of 4 points */
                if ((current_unparser_check_flags & PARSER_CHECK_MINPOINTS) && orig_cnt < 4)
                {
-                       lwfree(first_point);
-                       lwfree(last_point);
                        LWGEOM_WKT_UNPARSER_ERROR(UNPARSER_ERROR_MOREPOINTS);
                }
        }