diff options
Diffstat (limited to 'src/cmscgats.c')
-rw-r--r-- | src/cmscgats.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cmscgats.c b/src/cmscgats.c index 52ea255..72958a8 100644 --- a/src/cmscgats.c +++ b/src/cmscgats.c @@ -995,8 +995,10 @@ void InSymbol(cmsIT8* it8) if(FileNest == NULL) { FileNest = it8 ->FileStack[it8 -> IncludeSP + 1] = (FILECTX*)AllocChunk(it8, sizeof(FILECTX)); - //if(FileNest == NULL) - // TODO: how to manage out-of-memory conditions? + if (FileNest == NULL) { + SynError(it8, "Out of memory"); + return; + } } if (BuildAbsolutePath(StringPtr(it8->str), @@ -1170,10 +1172,11 @@ void* AllocChunk(cmsIT8* it8, cmsUInt32Number size) it8 ->Allocator.BlockSize = size; it8 ->Allocator.Used = 0; - it8 ->Allocator.Block = (cmsUInt8Number*) AllocBigBlock(it8, it8 ->Allocator.BlockSize); - if (it8->Allocator.Block == NULL) return NULL; + it8 ->Allocator.Block = (cmsUInt8Number*) AllocBigBlock(it8, it8 ->Allocator.BlockSize); } + if (it8->Allocator.Block == NULL) return NULL; + ptr = it8 ->Allocator.Block + it8 ->Allocator.Used; it8 ->Allocator.Used += size; |