]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Wed, 22 Aug 2012 16:30:29 +0000 (16:30 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Wed, 22 Aug 2012 16:30:29 +0000 (16:30 +0000)
MagickCore/blob.c

index 0a38244a6198d840e41dacaa206b35e3d6e2ff3a..e2506fae8dfdb85e49f3bc97df6cc4a31063e2a5 100644 (file)
@@ -1543,17 +1543,13 @@ MagickExport unsigned char *ImageToBlob(const ImageInfo *image_info,
           image->blob->exempt=MagickTrue;
           *image->filename='\0';
           status=WriteImage(blob_info,image,exception);
-          if (status != MagickFalse)
-            {
-              blob_info->blob=(unsigned char *)
-                RelinquishMagickMemory(blob_info->blob);
-              blob_info=DestroyImageInfo(blob_info);
-              return((unsigned char *) NULL);
-            }
           *length=image->blob->length;
           blob=DetachBlob(image->blob);
-          blob=(unsigned char *) ResizeQuantumMemory(blob,*length+1,
-            sizeof(*blob));
+          if (status == MagickFalse)
+            blob=(unsigned char *) RelinquishMagickMemory(blob);
+          else
+            blob=(unsigned char *) ResizeQuantumMemory(blob,*length+1,
+              sizeof(*blob));
         }
     }
   else