[mapserver-commits] r10615 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Oct 18 16:17:17 EDT 2010


Author: assefa
Date: 2010-10-18 13:17:17 -0700 (Mon, 18 Oct 2010)
New Revision: 10615

Modified:
   trunk/mapserver/mapwfs.c
   trunk/mapserver/mapwfs11.c
Log:
fix memory leaks #3573

Modified: trunk/mapserver/mapwfs.c
===================================================================
--- trunk/mapserver/mapwfs.c	2010-10-18 18:05:41 UTC (rev 10614)
+++ trunk/mapserver/mapwfs.c	2010-10-18 20:17:17 UTC (rev 10615)
@@ -2505,18 +2505,22 @@
 
         mapserv->sendheaders = MS_TRUE;
         mapserv->map = map;
+        msFreeCgiObj(mapserv->request);
         mapserv->request = req;
         map->querymap.status = MS_FALSE;
 
         status = msReturnTemplateQuery( mapserv, psFormat->name, NULL );
-        if( status != MS_SUCCESS )
-            return msWFSException(map, "mapserv", "NoApplicableCode", 
-                                  paramsObj->pszVersion );
-            
+
         mapserv->request = NULL;
         mapserv->map = NULL;
 
         msFreeMapServObj( mapserv );
+
+        if( status != MS_SUCCESS )
+        {
+            return msWFSException(map, "mapserv", "NoApplicableCode",
+                                  paramsObj->pszVersion );
+        }
     }
 
     if( psFormat == NULL && status == MS_SUCCESS )

Modified: trunk/mapserver/mapwfs11.c
===================================================================
--- trunk/mapserver/mapwfs11.c	2010-10-18 18:05:41 UTC (rev 10614)
+++ trunk/mapserver/mapwfs11.c	2010-10-18 20:17:17 UTC (rev 10615)
@@ -72,7 +72,7 @@
 
     xmlDocSetRootElement(psDoc, psRootNode);
 
-    psNsOws = xmlNewNs(psRootNode, BAD_CAST "http://www.opengis.net/ows", BAD_CAST "ows");
+    xmlNewNs(psRootNode, BAD_CAST "http://www.opengis.net/ows", BAD_CAST "ows");
 
     if (encoding)
         msIO_printf("Content-type: text/xml; charset=%s%c%c", encoding,10,10);
@@ -89,6 +89,7 @@
     free(schemasLocation);
     xmlFree(buffer);
     xmlFreeDoc(psDoc);
+    xmlFreeNs(psNsOws);
 
     /* clear error since we have already reported it */
     msResetErrorList();



More information about the mapserver-commits mailing list