2007-07-12  Mark Rowe  <mrowe@apple.com>

        Reviewed by Ada.

        <rdar://problem/5329877> REGRESSION: Document::setTransformSource leaks an xmlDocPtr if called more than once per document

        * dom/Document.cpp:
        (WebCore::Document::setTransformSource): Free any existing m_transformSource before overwriting it, rather than simply leaking it.
        * dom/Document.h:

2007-07-12  Mark Rowe  <mrowe@apple.com>

        Reviewed by Ada.

        Remove leak suppression for xmlDocPtrForString now that <rdar://problem/5329877> is fixed.

        * Scripts/run-webkit-tests:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24238 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 4f9cdf1..be72825 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -3203,6 +3203,15 @@
     processor->createDocumentFromSource(newSource, resultEncoding, resultMIMEType, this, frame());
 }
 
+void Document::setTransformSource(void* doc)
+{
+    if (doc == m_transformSource)
+        return;
+
+    xmlFreeDoc((xmlDocPtr)m_transformSource);
+    m_transformSource = doc;
+}
+
 #endif
 
 void Document::setDesignMode(InheritedBool value)