diff options
| author | Christian Stocker <chregu@php.net> | 2003-05-13 14:42:23 +0000 |
|---|---|---|
| committer | Christian Stocker <chregu@php.net> | 2003-05-13 14:42:23 +0000 |
| commit | cd1def8074779c23934ff02de768eaa580ae7433 (patch) | |
| tree | 838255359a205fa0f771446dab68d941c528ebcf /ext/domxml/php_domxml.c | |
| parent | 99af37d2c8d598aa825bbe71959e4f7e232aec9a (diff) | |
| download | php-git-cd1def8074779c23934ff02de768eaa580ae7433.tar.gz | |
fix possible segfault
Diffstat (limited to 'ext/domxml/php_domxml.c')
| -rw-r--r-- | ext/domxml/php_domxml.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 859b63f647..398f87066e 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -5406,13 +5406,16 @@ PHP_FUNCTION(domxml_xslt_result_dump_mem) DOMXML_GET_OBJ(xmldocp, idxml, le_domxmldocp); ret = xsltSaveResultToString(&doc_txt_ptr, &doc_txt_len, xmldocp, xsltstp); - if (ret < 0) { RETURN_FALSE; } - - RETVAL_STRINGL(doc_txt_ptr, doc_txt_len, 1); - xmlFree(doc_txt_ptr); + + if (doc_txt_ptr) { + RETVAL_STRINGL(doc_txt_ptr, doc_txt_len, 1); + xmlFree(doc_txt_ptr); + } else { + RETURN_EMPTY_STRING(); + } } /* }}} */ |
