]> granicus.if.org Git - php/commitdiff
use FREE_ZVAL where appropiate
authorThies C. Arntzen <thies@php.net>
Wed, 2 Feb 2000 11:31:37 +0000 (11:31 +0000)
committerThies C. Arntzen <thies@php.net>
Wed, 2 Feb 2000 11:31:37 +0000 (11:31 +0000)
ext/standard/var.c

index eb81332d567fbf890157eaf630f5aeef5a50dbe8..f745dc1017011272026aa239dbc04147447e968b 100644 (file)
@@ -107,7 +107,7 @@ void php_var_dump(pval **struc, int level)
                                                        d->type = IS_LONG;
                                                        d->value.lval = index;
                                                        php_var_dump(&d, level + 2);
-                                                       efree(d);
+                                                       FREE_ZVAL(d);
                                                }
                                                break;
 
@@ -120,7 +120,7 @@ void php_var_dump(pval **struc, int level)
                                                        d->value.str.len = strlen(key);
                                                        php_var_dump(&d, level + 2);
                                                        efree(key);
-                                                       efree(d);
+                                                       FREE_ZVAL(d);
                                                }
                                                break;
                                }
@@ -268,7 +268,7 @@ void php_var_serialize(pval *buf, pval **struc)
                                                        d->type = IS_LONG;
                                                        d->value.lval = index;
                                                        php_var_serialize(buf, &d);
-                                                       efree(d);
+                                                       FREE_ZVAL(d);
                                                        break;
                                                case HASH_KEY_IS_STRING:
                                                        ALLOC_ZVAL(d);  
@@ -277,7 +277,7 @@ void php_var_serialize(pval *buf, pval **struc)
                                                        d->value.str.len = strlen(key);
                                                        php_var_serialize(buf, &d);
                                                        efree(key);
-                                                       efree(d);
+                                                       FREE_ZVAL(d);
                                                        break;
                                        }
                                        php_var_serialize(buf, data);
@@ -392,7 +392,7 @@ int php_var_unserialize(pval **rval, const char **p, const char *max)
 
                        if (cur == 'a') {
                                (*rval)->type = IS_ARRAY;
-                               (*rval)->value.ht = (HashTable *) emalloc(sizeof(HashTable));
+                               ALLOC_HASHTABLE((*rval)->value.ht);
                                myht = (*rval)->value.ht;
                        } else {
                                zend_class_entry *ce;
@@ -459,15 +459,15 @@ int php_var_unserialize(pval **rval, const char **p, const char *max)
                                ALLOC_ZVAL(data);
                                if (!php_var_unserialize(&key, p, max)) {
                                        zval_dtor(key);
-                                       efree(key);
-                                       efree(data);
+                                       FREE_ZVAL(key);
+                                       FREE_ZVAL(data);
                                        return 0;
                                }
                                if (!php_var_unserialize(&data, p, max)) {
                                        zval_dtor(key);
-                                   efree(key);
+                                   FREE_ZVAL(key);
                                        zval_dtor(data);
-                                       efree(data);
+                                       FREE_ZVAL(data);
                                        return 0;
                                }
                                switch (key->type) {
@@ -478,8 +478,8 @@ int php_var_unserialize(pval **rval, const char **p, const char *max)
                                                zend_hash_update(myht, key->value.str.val, key->value.str.len + 1, &data, sizeof(data), NULL);
                                                break;
                                }
-                               pval_destructor(key);
-                               efree(key);
+                               zval_dtor(key);
+                               FREE_ZVAL(key);
                        }
                        return *((*p)++) == '}';