[mapserver-commits] r7638 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Jun 2 12:11:19 EDT 2008


Author: tomkralidis
Date: 2008-06-02 12:11:19 -0400 (Mon, 02 Jun 2008)
New Revision: 7638

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapgml.c
   trunk/mapserver/mapogcsos.c
Log:
- SOS: fix various memory leaks (#2412)



Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-06-02 15:26:55 UTC (rev 7637)
+++ trunk/mapserver/HISTORY.TXT	2008-06-02 16:11:19 UTC (rev 7638)
@@ -13,6 +13,8 @@
 Current Version (5.1-dev, SVN trunk):
 -------------------------------------
 
+- SOS: fix various memory leaks (#2412)
+
 - mapwcs.c: advertise temporal support in GetCapabilities (#2487)
 
 - Fixed flaw in findTag() in maptemplate.c that prevented multiple tags on the same line 

Modified: trunk/mapserver/mapgml.c
===================================================================
--- trunk/mapserver/mapgml.c	2008-06-02 15:26:55 UTC (rev 7637)
+++ trunk/mapserver/mapgml.c	2008-06-02 16:11:19 UTC (rev 7638)
@@ -1564,6 +1564,7 @@
 xmlNodePtr msGML3BoundedBy(xmlNsPtr psNs, double minx, double miny, double maxx, double maxy, const char *psEpsg) {
   xmlNodePtr psNode = NULL, psSubNode = NULL, psSubSubNode = NULL;
   char *pszTmp = NULL;
+  char *pszTmp2 = NULL;
   char pszEpsg[11];
 
   psNode = xmlNewNode(psNs, BAD_CAST "boundedBy");
@@ -1583,15 +1584,19 @@
 
   pszTmp = msDoubleToString(minx);
   pszTmp = msStringConcatenate(pszTmp, " ");
-  pszTmp = msStringConcatenate(pszTmp, msDoubleToString(miny));
+  pszTmp2 = msDoubleToString(miny);
+  pszTmp = msStringConcatenate(pszTmp, pszTmp2);
   psSubSubNode = xmlNewChild(psSubNode, NULL, BAD_CAST "lowerCorner", BAD_CAST pszTmp);
   free(pszTmp);
+  free(pszTmp2);
 
   pszTmp = msDoubleToString(maxx);
   pszTmp = msStringConcatenate(pszTmp, " ");
-  pszTmp = msStringConcatenate(pszTmp, msDoubleToString(maxy));
+  pszTmp2 = msDoubleToString(maxy); 
+  pszTmp = msStringConcatenate(pszTmp, pszTmp2);
   psSubSubNode = xmlNewChild(psSubNode, NULL, BAD_CAST "upperCorner", BAD_CAST pszTmp);
   free(pszTmp);
+  free(pszTmp2);
   return psNode;
 }
 

Modified: trunk/mapserver/mapogcsos.c
===================================================================
--- trunk/mapserver/mapogcsos.c	2008-06-02 15:26:55 UTC (rev 7637)
+++ trunk/mapserver/mapogcsos.c	2008-06-02 16:11:19 UTC (rev 7638)
@@ -331,9 +331,12 @@
 
             xmlNewNsProp(psNode, psNsXLink, BAD_CAST "href", BAD_CAST pszFullName);
             free(pszFullName);
+            free(pszTmpVal);
             j++;
         }
-        xmlNewNsProp(psCompNode, NULL, BAD_CAST "dimension", BAD_CAST msIntToString(j));
+        pszTmpVal = msIntToString(j); 
+        xmlNewNsProp(psCompNode, NULL, BAD_CAST "dimension", BAD_CAST pszTmpVal);
+        free(pszTmpVal);
     }	
 }
         
@@ -2383,9 +2386,10 @@
         if (tokens[k] && strlen(tokens[k]) > 0) {
           pszProcedureURI = strdup("urn:ogc:def:procedure:");
           pszProcedureURI = msStringConcatenate(pszProcedureURI, tokens[k]);
-          if (strcasecmp(pszProcedureURI, sosparams->pszProcedure) == 0) {
+          if (pszProcedureURI && strcasecmp(pszProcedureURI, sosparams->pszProcedure) == 0) {
             bFound = 1; 
             pszProcedureId = strdup(tokens[k]);
+            msFree(pszProcedureURI);
             msFreeCharArray(tokens, n);
             break;
           }
@@ -2408,6 +2412,7 @@
           msIO_printf("Location: %s\n\n", pszEncodedUrl);
           msFree(pszTmp);
           msFree(pszEncodedUrl);
+          msFree(pszProcedureId);
           return(MS_SUCCESS);
         }
         else {



More information about the mapserver-commits mailing list