[mapserver-commits] r11284 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Sat Mar 19 15:58:25 EDT 2011


Author: rouault
Date: 2011-03-19 12:58:25 -0700 (Sat, 19 Mar 2011)
New Revision: 11284

Modified:
   trunk/mapserver/mapproject.c
Log:
Fix memory error

Modified: trunk/mapserver/mapproject.c
===================================================================
--- trunk/mapserver/mapproject.c	2011-03-19 19:57:22 UTC (rev 11283)
+++ trunk/mapserver/mapproject.c	2011-03-19 19:58:25 UTC (rev 11284)
@@ -451,7 +451,9 @@
         && (line_out->point[0].x != line_out->point[line_out->numpoints-1].x
             || line_out->point[0].y != line_out->point[line_out->numpoints-1].y) )
     {
-        msAddPointToLine( line_out, line_out->point + 0 );
+        /* make a copy because msAddPointToLine can realloc the array */
+        pointObj sFirstPoint = line_out->point[0];
+        msAddPointToLine( line_out, &sFirstPoint );
     }
 
     return(MS_SUCCESS);



More information about the mapserver-commits mailing list