MCPcopy Index your code
hub / github.com/MapServer/MapServer / msSmallRealloc

Function msSmallRealloc

maputil.c:2169–2193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2167/* Safe version of realloc(). This function is taken from gdal/cpl. */
2168
2169void * msSmallRealloc( void * pData, size_t nNewSize )
2170{
2171 void *pReturn;
2172
2173 if ( nNewSize == 0 )
2174 return NULL;
2175
2176 if( nNewSize < 0 )
2177 {
2178 fprintf(stderr, "msSmallRealloc(%ld): Silly size requested.\n",
2179 (long) nNewSize );
2180 return NULL;
2181 }
2182
2183 pReturn = realloc( pData, nNewSize );
2184
2185 if( pReturn == NULL )
2186 {
2187 fprintf(stderr, "msSmallRealloc(): Out of memory allocating %ld bytes.\n",
2188 (long)nNewSize );
2189 exit(1);
2190 }
2191
2192 return pReturn;
2193}
2194
2195/************************************************************************/
2196/* msSmallCalloc() */

Callers 15

msReplaceSubstringFunction · 0.85
msStringSplitComplexFunction · 0.85
msCommifyStringFunction · 0.85
msCaseReplaceSubstringFunction · 0.85
msRasterQueryAddPixelFunction · 0.85
msWCSInsertAxisObj20Function · 0.85
msReturnPageFunction · 0.85
msGrowMapservLayersFunction · 0.85
msGetLayersIndexByGroupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected