[mapserver-commits] r10664 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Sun Oct 24 15:26:16 EDT 2010
Author: aboudreault
Date: 2010-10-24 12:26:16 -0700 (Sun, 24 Oct 2010)
New Revision: 10664
Modified:
trunk/mapserver/cgiutil.c
Log:
just modified the realloc checks...
Modified: trunk/mapserver/cgiutil.c
===================================================================
--- trunk/mapserver/cgiutil.c 2010-10-24 16:16:03 UTC (rev 10663)
+++ trunk/mapserver/cgiutil.c 2010-10-24 19:26:16 UTC (rev 10664)
@@ -170,8 +170,12 @@
if(m >= maxParams) {
maxParams *= 2;
request->ParamNames = (char **) realloc(request->ParamNames,sizeof(char *) * maxParams);
+ if (request->ParamNames == NULL) {
+ msIO_printf("Out of memory trying to allocate name/value pairs.\n");
+ exit(1);
+ }
request->ParamValues = (char **) realloc(request->ParamValues,sizeof(char *) * maxParams);
- if( (request->ParamNames == NULL) || (request->ParamValues == NULL) ) {
+ if (request->ParamValues == NULL) {
msIO_printf("Out of memory trying to allocate name/value pairs.\n");
exit(1);
}
@@ -199,8 +203,12 @@
if(m >= maxParams) {
maxParams *= 2;
request->ParamNames = (char **) realloc(request->ParamNames,sizeof(char *) * maxParams);
+ if (request->ParamNames == NULL) {
+ msIO_printf("Out of memory trying to allocate name/value pairs.\n");
+ exit(1);
+ }
request->ParamValues = (char **) realloc(request->ParamValues,sizeof(char *) * maxParams);
- if( (request->ParamNames == NULL) || (request->ParamValues == NULL) ) {
+ if (request->ParamValues == NULL) {
msIO_printf("Out of memory trying to allocate name/value pairs.\n");
exit(1);
}
@@ -238,8 +246,12 @@
if(m >= maxParams) {
maxParams *= 2;
request->ParamNames = (char **) realloc(request->ParamNames,sizeof(char *) * maxParams);
+ if (request->ParamNames == NULL) {
+ msIO_printf("Out of memory trying to allocate name/value pairs.\n");
+ exit(1);
+ }
request->ParamValues = (char **) realloc(request->ParamValues,sizeof(char *) * maxParams);
- if( (request->ParamNames == NULL) || (request->ParamValues == NULL) ) {
+ if (request->ParamValues == NULL) {
msIO_printf("Out of memory trying to allocate name/value pairs.\n");
exit(1);
}
@@ -266,8 +278,12 @@
if(m >= maxParams) {
maxParams *= 2;
request->ParamNames = (char **) realloc(request->ParamNames,sizeof(char *) * maxParams);
+ if (request->ParamNames == NULL) {
+ msIO_printf("Out of memory trying to allocate name/value pairs.\n");
+ exit(1);
+ }
request->ParamValues = (char **) realloc(request->ParamValues,sizeof(char *) * maxParams);
- if( (request->ParamNames == NULL) || (request->ParamValues == NULL) ) {
+ if (request->ParamValues == NULL) {
msIO_printf("Out of memory trying to allocate name/value pairs.\n");
exit(1);
}
More information about the mapserver-commits
mailing list