From: cristy Date: Sun, 28 Jul 2013 20:14:08 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~3463 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11cb483ebbcf59f0b971bcfd06815b2dda1da41f;p=imagemagick --- diff --git a/MagickCore/memory.c b/MagickCore/memory.c index 40366f571..aa5cea162 100644 --- a/MagickCore/memory.c +++ b/MagickCore/memory.c @@ -572,7 +572,9 @@ MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count, */ memory_info->mapped=MagickTrue; memory_info->blob=MapBlob(-1,IOMode,0,length); - if (memory_info->blob == NULL) + if (memory_info->blob != NULL) + memory_info->mapped=MagickTrue; + else RelinquishMagickResource(MapResource,length); } if (memory_info->blob == NULL) @@ -588,10 +590,12 @@ MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count, { if ((lseek(file,length-1,SEEK_SET) >= 0) && (write(file,"",1) == 1)) { - memory_info->mapped=MagickTrue; memory_info->blob=MapBlob(file,IOMode,0,length); if (memory_info->blob != NULL) - (void) AcquireMagickResource(MapResource,length); + { + memory_info->mapped=MagickTrue; + (void) AcquireMagickResource(MapResource,length); + } } (void) close(file); }