MFH: fix bug #47220 (segfault in dom_document_parser in recovery mode)

This commit is contained in:
Rob Richards 2009-01-26 19:10:53 +00:00
parent 51f4e5efcd
commit cbdb8f6167

View file

@ -1625,7 +1625,7 @@ static xmlDocPtr dom_document_parser(zval *id, int mode, char *source, int optio
EG(error_reporting) = old_error_reporting;
}
/* If loading from memory, set the base reference uri for the document */
if (ret->URL == NULL && ctxt->directory != NULL) {
if (ret && ret->URL == NULL && ctxt->directory != NULL) {
ret->URL = xmlStrdup(ctxt->directory);
}
} else {