diff --git a/content/html/style/src/nsCSSStyleSheet.cpp b/content/html/style/src/nsCSSStyleSheet.cpp
index ed26e26bb05..b593d52e97a 100644
--- a/content/html/style/src/nsCSSStyleSheet.cpp
+++ b/content/html/style/src/nsCSSStyleSheet.cpp
@@ -1005,7 +1005,7 @@ static void PseudoEnumFunc(nsICSSStyleRule* aRule, void* aData)
content->GetParent(content);
NS_IF_RELEASE(lastContent);
}
- NS_IF_RELEASE(lastContent);
+ NS_IF_RELEASE(content);
if (nsnull == selector) { // ran out, it matched
nsIStyleRule* iRule;
if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) {
diff --git a/layout/html/style/src/nsCSSStyleSheet.cpp b/layout/html/style/src/nsCSSStyleSheet.cpp
index ed26e26bb05..b593d52e97a 100644
--- a/layout/html/style/src/nsCSSStyleSheet.cpp
+++ b/layout/html/style/src/nsCSSStyleSheet.cpp
@@ -1005,7 +1005,7 @@ static void PseudoEnumFunc(nsICSSStyleRule* aRule, void* aData)
content->GetParent(content);
NS_IF_RELEASE(lastContent);
}
- NS_IF_RELEASE(lastContent);
+ NS_IF_RELEASE(content);
if (nsnull == selector) { // ran out, it matched
nsIStyleRule* iRule;
if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) {
diff --git a/layout/style/nsCSSStyleSheet.cpp b/layout/style/nsCSSStyleSheet.cpp
index ed26e26bb05..b593d52e97a 100644
--- a/layout/style/nsCSSStyleSheet.cpp
+++ b/layout/style/nsCSSStyleSheet.cpp
@@ -1005,7 +1005,7 @@ static void PseudoEnumFunc(nsICSSStyleRule* aRule, void* aData)
content->GetParent(content);
NS_IF_RELEASE(lastContent);
}
- NS_IF_RELEASE(lastContent);
+ NS_IF_RELEASE(content);
if (nsnull == selector) { // ran out, it matched
nsIStyleRule* iRule;
if (NS_OK == aRule->QueryInterface(kIStyleRuleIID, (void**)&iRule)) {