PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ if() [3/9]

if ( nEntitySize  ,
psSHP->  nBufSize 
)

Definition at line 1580 of file shpopen.c.

References SAHooks::Error, malloc(), SHPInfo::nBufSize, nEntitySize, SHPInfo::pabyRec, SfRealloc(), and SHPInfo::sHooks.

1581  {
1582  psSHP->pabyRec = (uchar *) SfRealloc(psSHP->pabyRec,nEntitySize);
1583  if (psSHP->pabyRec == NULL)
1584  {
1585  char szError[200];
1586 
1587  /* Reallocate previous successfull size for following features */
1588  psSHP->pabyRec = malloc(psSHP->nBufSize);
1589 
1590  sprintf( szError,
1591  "Not enough memory to allocate requested memory (nBufSize=%d). "
1592  "Probably broken SHP file", psSHP->nBufSize );
1593  psSHP->sHooks.Error( szError );
1594  return NULL;
1595  }
1596 
1597  /* Only set new buffer size after successfull alloc */
1598  psSHP->nBufSize = nEntitySize;
1599  }
static void * SfRealloc(void *pMem, int nNewSize)
Definition: shpopen.c:323
nEntitySize
Definition: shpopen.c:1579
void * malloc(YYSIZE_T)
unsigned char uchar
Definition: shpopen.c:268
Here is the call graph for this function: