[mapserver-commits] r12798 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Nov 23 11:26:33 EST 2011


Author: assefa
Date: 2011-11-23 08:26:33 -0800 (Wed, 23 Nov 2011)
New Revision: 12798

Modified:
   trunk/mapserver/mapwms.c
Log:
correct memory leaks (#3466)

Modified: trunk/mapserver/mapwms.c
===================================================================
--- trunk/mapserver/mapwms.c	2011-11-23 14:21:15 UTC (rev 12797)
+++ trunk/mapserver/mapwms.c	2011-11-23 16:26:33 UTC (rev 12798)
@@ -506,7 +506,9 @@
 	extents = NULL;
     }
 
+    
 
+
     /* make sure that we got a valid extent*/
     if (!isextentavalue && !isextentarange)
     {
@@ -582,6 +584,8 @@
 		}
 	    }
 	}
+	if (ranges && ntmp > 0)
+	  msFreeCharArray(ranges, ntmp);
     }
     else if (numuservalues > 1)	/*user input=multiple*/
     {
@@ -688,6 +692,18 @@
     if(uservalues && numuservalues > 0)
       msFreeCharArray(uservalues, numuservalues);
 
+    if (aextentvalues && nextentvalues > 0)
+    {
+	for (i=0; i<nextentvalues; i++)
+	  msFree(aextentvalues[i]);
+	msFree(aextentvalues);
+    }
+
+    if(aextentranges && nextentranges > 0)
+    {
+	msFree(aextentranges);
+    }
+
     if(uservaluevalid)
       return MS_TRUE;
 



More information about the mapserver-commits mailing list