summaryrefslogtreecommitdiff
path: root/ext/soap/php_xml.c
diff options
context:
space:
mode:
authorNuno Lopes <nlopess@php.net>2007-01-29 19:36:53 +0000
committerNuno Lopes <nlopess@php.net>2007-01-29 19:36:53 +0000
commit37960644dff466052840b9f50a7687bd8d0d30a9 (patch)
tree462356bcea430081487b930513d0a513f11b87cf /ext/soap/php_xml.c
parent47514fd793fbc62d469abae82c4bc04bd725ded8 (diff)
downloadphp-git-37960644dff466052840b9f50a7687bd8d0d30a9.tar.gz
fix access to already free'ed memory
Diffstat (limited to 'ext/soap/php_xml.c')
-rw-r--r--ext/soap/php_xml.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c
index c5dbd640de..4e15fd64e8 100644
--- a/ext/soap/php_xml.c
+++ b/ext/soap/php_xml.c
@@ -87,12 +87,17 @@ xmlDocPtr soap_xmlParseFile(const char *filename TSRMLS_DC)
*/
old_allow_url_fopen_list = PG(allow_url_fopen_list);
- if (!old_allow_url_fopen_list) {
- old_allow_url_fopen_list = "";
+ if (old_allow_url_fopen_list) {
+ old_allow_url_fopen_list = estrdup(old_allow_url_fopen_list);
+ } else {
+ old_allow_url_fopen_list = STR_EMPTY_ALLOC();
}
+
zend_alter_ini_entry("allow_url_fopen", sizeof("allow_url_fopen"), "*", 1, PHP_INI_SYSTEM, PHP_INI_STAGE_RUNTIME);
ctxt = xmlCreateFileParserCtxt(filename);
zend_alter_ini_entry("allow_url_fopen", sizeof("allow_url_fopen"), old_allow_url_fopen_list, strlen(old_allow_url_fopen_list), PHP_INI_SYSTEM, PHP_INI_STAGE_RUNTIME);
+ efree(old_allow_url_fopen_list);
+
if (ctxt) {
ctxt->keepBlanks = 0;
ctxt->sax->ignorableWhitespace = soap_ignorableWhitespace;