From: dirk Date: Sun, 12 Apr 2015 14:33:23 +0000 (+0000) Subject: Fixed duplicate call to ShredFile. X-Git-Tag: 7.0.1-0~1110 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48b8beac6f2f2840d1f8a344b315afe4331fabe0;p=imagemagick Fixed duplicate call to ShredFile. --- diff --git a/MagickCore/resource.c b/MagickCore/resource.c index 1031dad69..16c197991 100644 --- a/MagickCore/resource.c +++ b/MagickCore/resource.c @@ -979,18 +979,24 @@ MagickExport MagickBooleanType RelinquishUniqueFileResource(const char *path) char cache_path[MaxTextExtent]; + MagickBooleanType + status; + assert(path != (const char *) NULL); + status=MagickFalse; (void) LogMagickEvent(ResourceEvent,GetMagickModule(),"%s",path); if (resource_semaphore == (SemaphoreInfo *) NULL) ActivateSemaphoreInfo(&resource_semaphore); LockSemaphoreInfo(resource_semaphore); if (temporary_resources != (SplayTreeInfo *) NULL) - (void) DeleteNodeFromSplayTree(temporary_resources, (const void *) path); + status=DeleteNodeFromSplayTree(temporary_resources, (const void *) path); UnlockSemaphoreInfo(resource_semaphore); (void) CopyMagickString(cache_path,path,MaxTextExtent); AppendImageFormat("cache",cache_path); (void) ShredFile(cache_path); - return(ShredFile(path)); + if (status == MagickFalse) + status=ShredFile(path); + return(status); } /*