From: cristy Date: Thu, 18 Jul 2013 22:14:51 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~3493 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=419e204da25031ea4971130c1edcbfa0d8c57cca;p=imagemagick --- diff --git a/MagickCore/artifact.c b/MagickCore/artifact.c index 59ca6dedb..ded06db37 100644 --- a/MagickCore/artifact.c +++ b/MagickCore/artifact.c @@ -112,8 +112,12 @@ MagickExport MagickBooleanType CloneImageArtifacts(Image *image, (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", clone_image->filename); if (clone_image->artifacts != (void *) NULL) - image->artifacts=CloneSplayTree((SplayTreeInfo *) clone_image->artifacts, - (void *(*)(void *)) ConstantString,(void *(*)(void *)) ConstantString); + { + if (image->artifacts != (void *) NULL) + DestroyImageArtifacts(image); + image->artifacts=CloneSplayTree((SplayTreeInfo *) clone_image->artifacts, + (void *(*)(void *)) ConstantString,(void *(*)(void *)) ConstantString); + } return(MagickTrue); } diff --git a/MagickCore/profile.c b/MagickCore/profile.c index 1c81f619b..0b9235584 100644 --- a/MagickCore/profile.c +++ b/MagickCore/profile.c @@ -163,8 +163,12 @@ MagickExport MagickBooleanType CloneImageProfiles(Image *image, assert(clone_image != (const Image *) NULL); assert(clone_image->signature == MagickSignature); if (clone_image->profiles != (void *) NULL) - image->profiles=CloneSplayTree((SplayTreeInfo *) clone_image->profiles, - (void *(*)(void *)) ConstantString,(void *(*)(void *)) CloneStringInfo); + { + if (image->profiles != (void *) NULL) + DestroyImageProfiles(image); + image->profiles=CloneSplayTree((SplayTreeInfo *) clone_image->profiles, + (void *(*)(void *)) ConstantString,(void *(*)(void *)) CloneStringInfo); + } return(MagickTrue); }