[mapserver-commits] r9286 - branches/branch-5-4/mapserver

svn at osgeo.org svn at osgeo.org
Tue Sep 1 06:41:02 EDT 2009


Author: tamas
Date: 2009-09-01 06:41:01 -0400 (Tue, 01 Sep 2009)
New Revision: 9286

Modified:
   branches/branch-5-4/mapserver/HISTORY.TXT
   branches/branch-5-4/mapserver/mapobject.c
Log:
Fixed msFreeMap causing memory corruption in msFreeOutputFormat (#3113)

Modified: branches/branch-5-4/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-5-4/mapserver/HISTORY.TXT	2009-09-01 10:35:45 UTC (rev 9285)
+++ branches/branch-5-4/mapserver/HISTORY.TXT	2009-09-01 10:41:01 UTC (rev 9286)
@@ -14,6 +14,8 @@
 Current Version:
 ----------------
 
+- Fixed msFreeMap causing memory corruption in msFreeOutputFormat (#3113)
+
 - Fix WMC XML output when Dimension is used (#3110)
 
 - Fix output for valid WCS 1.1 XML (#3086)

Modified: branches/branch-5-4/mapserver/mapobject.c
===================================================================
--- branches/branch-5-4/mapserver/mapobject.c	2009-09-01 10:35:45 UTC (rev 9285)
+++ branches/branch-5-4/mapserver/mapobject.c	2009-09-01 10:41:01 UTC (rev 9286)
@@ -95,11 +95,11 @@
 
   msFreeLabelCache(&(map->labelcache));
 
-  if( map->outputformat && --map->outputformat->refcount < 1 )
+  if( map->outputformat && map->outputformat->refcount > 0 && --map->outputformat->refcount < 1 )
       msFreeOutputFormat( map->outputformat );
 
   for(i=0; i < map->numoutputformats; i++ ) {
-      if( --map->outputformatlist[i]->refcount < 1 )
+      if( map->outputformatlist[i]->refcount > 0 && --map->outputformatlist[i]->refcount < 1 )
       msFreeOutputFormat( map->outputformatlist[i] );
   }
   if( map->outputformatlist != NULL )



More information about the mapserver-commits mailing list