File ImageMagick-CVE-2018-11655.patch of Package ImageMagick.8212

diff --git a/magick/cache.c b/magick/cache.c
index 655ca063d0..f011942f5a 100644
--- a/magick/cache.c
+++ b/magick/cache.c
@@ -1890,7 +1890,9 @@ static Cache GetImagePixelCache(Image *image,const MagickBooleanType clone,
               if (clone != MagickFalse)
                 status=ClonePixelCacheRepository(clone_info,cache_info,
                   exception);
-              if (status != MagickFalse)
+              if (status == MagickFalse)
+                clone_info=(CacheInfo *) DestroyPixelCache(clone_info);
+              else
                 {
                   destroy=MagickTrue;
                   image->cache=clone_info;