summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/dom/document.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 30d9c13ee9..17ac30a991 100644
--- a/ext/dom/document.c
+++ b/ext/dom/document.c
@@ -1663,7 +1663,7 @@ PHP_FUNCTION(dom_document_savexml)
if (options & LIBXML_SAVE_NOEMPTYTAG) {
xmlSaveNoEmptyTags = saveempty;
}
- if (!size) {
+ if (!size || !mem) {
RETURN_FALSE;
}
RETVAL_STRINGL((char *) mem, size);
@@ -2215,7 +2215,7 @@ PHP_FUNCTION(dom_document_save_html)
#else
htmlDocDumpMemory(docp, &mem, &size);
#endif
- if (!size) {
+ if (!size || !mem) {
RETVAL_FALSE;
} else {
RETVAL_STRINGL((const char*) mem, size);