diff options
author | Thies C. Arntzen <thies@php.net> | 1999-08-08 11:37:50 +0000 |
---|---|---|
committer | Thies C. Arntzen <thies@php.net> | 1999-08-08 11:37:50 +0000 |
commit | 78f8d04e6323b1d7715db60d56275dee4fc1e554 (patch) | |
tree | 3b4ca7ce68444ee07496785cf253b85c1daa2ad6 | |
parent | 720d32f5819fb0a1a75dce31afc1fd957a7d4a12 (diff) | |
download | php-git-78f8d04e6323b1d7715db60d56275dee4fc1e554.tar.gz |
fix for #1995 (this module needs some more work.)
-rw-r--r-- | ext/xml/xml.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 4018e0986f..2f7b548abb 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -102,7 +102,8 @@ DLEXPORT php3_module_entry *get_module() { return &xml_module_entry; }; PHPAPI pval *php3i_long_pval(long value) { - pval *ret = emalloc(sizeof(pval)); + pval *ret; + MAKE_STD_ZVAL(ret); ret->type = IS_LONG; ret->value.lval = value; @@ -114,7 +115,8 @@ PHPAPI pval *php3i_long_pval(long value) PHPAPI pval *php3i_double_pval(double value) { - pval *ret = emalloc(sizeof(pval)); + pval *ret; + MAKE_STD_ZVAL(ret); ret->type = IS_DOUBLE; ret->value.dval = value; @@ -126,8 +128,9 @@ PHPAPI pval *php3i_double_pval(double value) PHPAPI pval *php3i_string_pval(const char *str) { - pval *ret = emalloc(sizeof(pval)); + pval *ret; int len = strlen(str); + MAKE_STD_ZVAL(ret); ret->type = IS_STRING; ret->value.str.len = len; @@ -703,7 +706,7 @@ void php3i_xml_startElementHandler(void *userData, const char *name, if (parser->startElementHandler) { args[0] = php3i_long_pval(parser->index); args[1] = php3i_string_pval(name); - args[2] = emalloc(sizeof(pval)); + MAKE_STD_ZVAL(args[2]); array_init(args[2]); while (attributes && *attributes) { char *key = (char *)attributes[0]; |