Possible dangling CachedResourceClient of StyleRuleImport and XSLImportRule
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Aug 2013 16:40:01 +0000 (16:40 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Aug 2013 16:40:01 +0000 (16:40 +0000)
commit4dc64093786fe50fbacf602735b85c3b0cb70e13
tree3fcf828381e266cc6a8efe98bede57bbd2e49383
parent9f8ad9bbfd19c0ce7d231e24e25ee338505795bd
Possible dangling CachedResourceClient of StyleRuleImport and XSLImportRule
https://bugs.webkit.org/show_bug.cgi?id=120479

Patch by Leo Yang <leoyang@blackberry.com> on 2013-08-30
Reviewed by Darin Adler.

In StyleRuleImport::requestStyleSheet() and XSLImportRule::loadSheet() we
didn't call removeClient() for m_cachedSheet before assigning m_cachedSheet
a new value. This could leave the client as a client of the old cached
sheet and dangling after the client is deleted. Fix them by calling removeClient()
before assigning m_cacheSheet a new value.

Found by code inspection. Seems no way to test it automatically.

* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::requestStyleSheet):
* xml/XSLImportRule.cpp:
(WebCore::XSLImportRule::loadSheet):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154889 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/StyleRuleImport.cpp
Source/WebCore/xml/XSLImportRule.cpp