From 028e5500469bbcb4e6d35ffa935c0dd57babf593 Mon Sep 17 00:00:00 2001 From: "jruderman@hmc.edu" Date: Tue, 6 Nov 2007 22:46:35 -0800 Subject: [PATCH] Fix bug 398880, getElementsByClassName('') leaks an nsVoidArray. r=sayrer, sr=jst, a=blocking1.9+. --- content/base/src/nsDocument.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 4567ccb8351..ad3d4fb2c19 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -1738,6 +1738,8 @@ nsDocument::GetElementsByClassNameHelper(nsINode* aRootNode, elements = new nsContentList(aRootNode, MatchClassNames, DestroyClassNameArray, classes); } else { + delete classes; + classes = nsnull; elements = new nsBaseContentList(); } if (!elements) {