diff --git a/content/html/document/src/nsHTMLContentSink.cpp b/content/html/document/src/nsHTMLContentSink.cpp index 4bc08f3d30c6..9a07d08306e7 100644 --- a/content/html/document/src/nsHTMLContentSink.cpp +++ b/content/html/document/src/nsHTMLContentSink.cpp @@ -423,6 +423,7 @@ HTMLContentSink::SetTitle(const nsString& aValue) nsresult rv = NS_NewHTMLTitle(&it, atom, aValue); if (NS_OK == rv) { mHead->AppendChild(it, PR_FALSE); + NS_RELEASE(it); } NS_RELEASE(atom); return NS_OK; diff --git a/layout/html/document/src/nsHTMLContentSink.cpp b/layout/html/document/src/nsHTMLContentSink.cpp index 4bc08f3d30c6..9a07d08306e7 100644 --- a/layout/html/document/src/nsHTMLContentSink.cpp +++ b/layout/html/document/src/nsHTMLContentSink.cpp @@ -423,6 +423,7 @@ HTMLContentSink::SetTitle(const nsString& aValue) nsresult rv = NS_NewHTMLTitle(&it, atom, aValue); if (NS_OK == rv) { mHead->AppendChild(it, PR_FALSE); + NS_RELEASE(it); } NS_RELEASE(atom); return NS_OK;