Bug 1361892 - Null check pointer before calling Release. r=erahm.

--HG--
extra : rebase_source : b80444629fc5cf92431297fd3bae61f805537162
This commit is contained in:
Peter Van der Beken 2017-05-08 17:02:12 +02:00
parent d2f951ca78
commit c2849d4c0b
3 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script id=o_xml type="text/plain"><?xml version="1.0" encoding="UTF-8"?>
<tag_name/>
</script>
<script id=o_xslt type="text/plain"><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="42">
<xsl:template match="*">
<xsl:value-of xmlns:regexp="http://exslt.org/regular-expressions" select="regexp:match('foo','bar','-2')"/>
</xsl:template>
</xsl:stylesheet>
</script>
<script>
window.onload = function(){
let doc = new DOMParser(), proc = new XSLTProcessor();
proc.importStylesheet(doc.parseFromString(document.getElementById('o_xslt').textContent, "text/xml"));
proc.transformToDocument(doc.parseFromString(document.getElementById('o_xml').textContent, "text/xml"));
};
</script>
</head>
</html>

View File

@ -19,3 +19,4 @@ load 1089049.html
load 1205163.xml
load 1243337.xml
load 1338277.html
load 1361892.html

View File

@ -345,7 +345,9 @@ txParamArrayHolder::~txParamArrayHolder()
variant.type.TagPart() == nsXPTType::T_INTERFACE_IS,
"We only support cleanup of strings and interfaces "
"here, and this looks like neither!");
static_cast<nsISupports*>(variant.val.p)->Release();
if (variant.val.p != nullptr) {
static_cast<nsISupports*>(variant.val.p)->Release();
}
}
}
}