From a5c7e92b4e360ef13464fba0b4bb5d65de2fb0a2 Mon Sep 17 00:00:00 2001 From: "troy@netscape.com" Date: Wed, 12 Aug 1998 01:36:25 +0000 Subject: [PATCH] Fixed a leak of the HTML title --- content/html/document/src/nsHTMLContentSink.cpp | 1 + layout/html/document/src/nsHTMLContentSink.cpp | 1 + 2 files changed, 2 insertions(+) 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;