summaryrefslogtreecommitdiff
path: root/ext/standard
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard')
-rw-r--r--ext/standard/iptc.c2
-rw-r--r--ext/standard/post.c6
-rw-r--r--ext/standard/var.c12
3 files changed, 10 insertions, 10 deletions
diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c
index cd6d107f4f..64e886faa5 100644
--- a/ext/standard/iptc.c
+++ b/ext/standard/iptc.c
@@ -356,7 +356,7 @@ PHP_FUNCTION(iptcparse)
}
if (zend_hash_find(return_value->value.ht,key,strlen(key) + 1,(void **) &element) == FAILURE) {
- values = emalloc(sizeof(pval));
+ values = ALLOC_ZVAL();
INIT_PZVAL(values);
if (array_init(values) == FAILURE) {
php_error(E_ERROR, "Unable to initialize array");
diff --git a/ext/standard/post.c b/ext/standard/post.c
index 4984b82837..b41007239a 100644
--- a/ext/standard/post.c
+++ b/ext/standard/post.c
@@ -112,7 +112,7 @@ void php_parse_gpc_data(char *val, char *var, pval *track_vars_array ELS_DC PLS_
}
/* Create the element */
- array_element = (pval *) emalloc(sizeof(pval));
+ array_element = ALLOC_ZVAL();
INIT_PZVAL(array_element);
array_element->value.str.val = val;
array_element->value.str.len = val_len;
@@ -315,7 +315,7 @@ void php_treat_data(int arg, char *str ELS_DC PLS_DC SLS_DC)
case PARSE_GET:
case PARSE_COOKIE:
if (PG(track_vars)) {
- array_ptr = (pval *) emalloc(sizeof(pval));
+ array_ptr = ALLOC_ZVAL();
array_init(array_ptr);
INIT_PZVAL(array_ptr);
switch (arg) {
@@ -369,7 +369,7 @@ void php_treat_data(int arg, char *str ELS_DC PLS_DC SLS_DC)
if((NULL != SG(request_info).content_type) && (0 == strcmp(SG(request_info).content_type, "application/vnd.fdf"))) {
pval *tmp;
- tmp = (pval *) emalloc(sizeof(pval));
+ tmp = ALLOC_ZVAL();
tmp->value.str.len = SG(request_info).post_data_length;
tmp->value.str.val = estrndup(SG(request_info).post_data, SG(request_info).post_data_length);
tmp->type = IS_STRING;
diff --git a/ext/standard/var.c b/ext/standard/var.c
index 736971a724..263dfad42c 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -96,7 +96,7 @@ void php_var_dump(pval **struc, int level)
}
switch (i) {
case HASH_KEY_IS_LONG:{
- pval *d = emalloc(sizeof(pval));
+ pval *d = ALLOC_ZVAL();
d->type = IS_LONG;
d->value.lval = index;
@@ -106,7 +106,7 @@ void php_var_dump(pval **struc, int level)
break;
case HASH_KEY_IS_STRING:{
- pval *d = emalloc(sizeof(pval));
+ pval *d = ALLOC_ZVAL();
d->type = IS_STRING;
d->value.str.val = key;
@@ -253,14 +253,14 @@ void php_var_serialize(pval *buf, pval **struc)
switch (i) {
case HASH_KEY_IS_LONG:
- d = emalloc(sizeof(pval));
+ d = ALLOC_ZVAL();
d->type = IS_LONG;
d->value.lval = index;
php_var_serialize(buf, &d);
efree(d);
break;
case HASH_KEY_IS_STRING:
- d = emalloc(sizeof(pval));
+ d = ALLOC_ZVAL();
d->type = IS_STRING;
d->value.str.val = key;
d->value.str.len = strlen(key);
@@ -431,8 +431,8 @@ int php_var_unserialize(pval **rval, const char **p, const char *max)
return 0;
}
for ((*p) += 2; **p && **p != '}' && i > 0; i--) {
- pval *key = emalloc(sizeof(pval));
- pval *data = emalloc(sizeof(pval));
+ pval *key = ALLOC_ZVAL();
+ pval *data = ALLOC_ZVAL();
if (!php_var_unserialize(&key, p, max)) {
zval_dtor(key);