[mapserver-commits] r11054 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Thu Mar 3 17:15:08 EST 2011


Author: rouault
Date: 2011-03-03 14:15:08 -0800 (Thu, 03 Mar 2011)
New Revision: 11054

Modified:
   trunk/mapserver/mapwcs20.c
Log:
mapwcs20 : use VSI memory allocation routines since we destroy with CSLDestroy()

Modified: trunk/mapserver/mapwcs20.c
===================================================================
--- trunk/mapserver/mapwcs20.c	2011-03-03 21:49:32 UTC (rev 11053)
+++ trunk/mapserver/mapwcs20.c	2011-03-03 22:15:08 UTC (rev 11054)
@@ -1194,10 +1194,22 @@
                 return MS_FAILURE;
             }
             tokens = msStringSplit(value, ',', &num);
-            params->ids = (char **) msSmallCalloc(num + 1, sizeof(char *));
+            params->ids = (char **) VSICalloc(num + 1, sizeof(char *));
+            if (params->ids == NULL)
+            {
+                fprintf(stderr, "VSICalloc(): Out of memory allocating %ld bytes.\n",
+                        (long)((num + 1)*sizeof(char *)));
+                exit(1);
+            }
             for (j = 0; j < num; ++j)
             {
-                params->ids[j] = msStrdup(tokens[j]);
+                params->ids[j] = VSIStrdup(tokens[j]);
+                if (params->ids[j] == NULL)
+                {
+                    fprintf(stderr, "VSIStrdup(): Out of memory allocating %ld bytes.\n",
+                        (long)(strlen(tokens[j])));
+                    exit(1);
+                }
             }
             msFreeCharArray(tokens, num);
         }



More information about the mapserver-commits mailing list