Commit 2c9c365a authored by Mark Cave-Ayland's avatar Mark Cave-Ayland
Browse files

Remove a double-free bug caused if the unparser finds an invalid geometry (fixes #168)


git-svn-id: http://svn.osgeo.org/postgis/trunk@4078 b70326c6-7e19-0410-871a-916f4a2858ee
parent b5615b4f
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -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);
		}
	}