summaryrefslogtreecommitdiff
path: root/ext/dom/domimplementation.c
diff options
context:
space:
mode:
authorMichael Wallner <mike@php.net>2006-02-24 10:19:54 (GMT)
committerMichael Wallner <mike@php.net>2006-02-24 10:19:54 (GMT)
commit6520ff9afca625a7b9d9fb00acd1f816a54dabde (patch)
treea0870f009dc5084d07c8979181aaadace2465a46 /ext/dom/domimplementation.c
parent521502f416efc037ceeec33c29738c278048954b (diff)
downloadphp-6520ff9afca625a7b9d9fb00acd1f816a54dabde.tar.gz
- fix crash with DOMImplementation::createDocumentType("name:")
Diffstat (limited to 'ext/dom/domimplementation.c')
-rw-r--r--ext/dom/domimplementation.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c
index aa371f8..f65da05 100644
--- a/ext/dom/domimplementation.c
+++ b/ext/dom/domimplementation.c
@@ -92,7 +92,7 @@ PHP_METHOD(domimplementation, createDocumentType)
pch2 = systemid;
uri = xmlParseURI(name);
- if (uri->opaque != NULL) {
+ if (uri != NULL && uri->opaque != NULL) {
localname = xmlStrdup(uri->opaque);
if (xmlStrchr(localname, (xmlChar) ':') != NULL) {
php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC);
@@ -108,7 +108,9 @@ PHP_METHOD(domimplementation, createDocumentType)
php_dom_throw_error(INVALID_CHARACTER_ERR, TSRMLS_CC);
*/
- xmlFreeURI(uri);
+ if (uri) {
+ xmlFreeURI(uri);
+ }
doctype = xmlCreateIntSubset(NULL, localname, pch1, pch2);
xmlFree(localname);