]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/threshold.c
(no commit message)
[imagemagick] / MagickCore / threshold.c
index e1d7e30d19d8f6d2c30e1db21f7c63ce1b487e34..e7f1103bd77590e4750febc61c3021f2f973555c 100644 (file)
@@ -885,11 +885,11 @@ MagickExport ThresholdMap *GetThresholdMap(const char *map_id,
     map=GetThresholdMapFile((const char *) GetStringInfoDatum(option),
       GetStringInfoPath(option),map_id,exception);
     if (map != (ThresholdMap *) NULL)
-      return(map);
+      break;
     option=(const StringInfo *) GetNextValueInLinkedList(options);
   }
   options=DestroyConfigureOptions(options);
-  return((ThresholdMap *) NULL);
+  return(map);
 }
 \f
 /*
@@ -965,7 +965,10 @@ static ThresholdMap *GetThresholdMapFile(const char *xml,const char *filename,
       break;
   }
   if (threshold == (XMLTreeInfo *) NULL)
-    return(map);
+    {
+      thresholds=DestroyXMLTree(thresholds);
+      return(map);
+    }
   description=GetXMLTreeChild(threshold,"description");
   if (description == (XMLTreeInfo *) NULL)
     {