]> granicus.if.org Git - php/commitdiff
use efree_size here
authorXinchen Hui <laruence@php.net>
Wed, 12 Aug 2015 03:15:09 +0000 (11:15 +0800)
committerXinchen Hui <laruence@php.net>
Wed, 12 Aug 2015 03:15:09 +0000 (11:15 +0800)
Zend/zend_compile.c
Zend/zend_inheritance.c

index 9c54245c4174b3d90940afa5172c93a0532ce0f4..c73ca985588157b3b8b515694f217231920d8145 100644 (file)
@@ -879,9 +879,9 @@ zend_string *zend_resolve_class_name_ast(zend_ast *ast) /* {{{ */
 }
 /* }}} */
 
-static void ptr_dtor(zval *zv) /* {{{ */
+static void label_ptr_dtor(zval *zv) /* {{{ */
 {
-       efree(Z_PTR_P(zv));
+       efree_size(Z_PTR_P(zv), sizeof(zend_label));
 }
 /* }}} */
 
@@ -3747,7 +3747,7 @@ void zend_compile_label(zend_ast *ast) /* {{{ */
 
        if (!CG(context).labels) {
                ALLOC_HASHTABLE(CG(context).labels);
-               zend_hash_init(CG(context).labels, 8, NULL, ptr_dtor, 0);
+               zend_hash_init(CG(context).labels, 8, NULL, label_ptr_dtor, 0);
        }
 
        dest.brk_cont = CG(context).current_brk_cont;
index c794c969c0ab2722288950df28cbfbfa43c3a2fc..77ea7d5f3fb760d5afcb67b3ca4c97f5ef3248a3 100644 (file)
@@ -25,9 +25,9 @@
 #include "zend_smart_str.h"
 #include "zend_inheritance.h"
 
-static void ptr_dtor(zval *zv) /* {{{ */
+static void overriden_ptr_dtor(zval *zv) /* {{{ */
 {
-       efree(Z_PTR_P(zv));
+       efree_size(Z_PTR_P(zv), sizeof(zend_function));
 }
 /* }}} */
 
@@ -1098,7 +1098,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, zend_s
                                }
                        } else {
                                ALLOC_HASHTABLE(*overriden);
-                               zend_hash_init_ex(*overriden, 8, NULL, ptr_dtor, 0, 0);
+                               zend_hash_init_ex(*overriden, 8, NULL, overriden_ptr_dtor, 0, 0);
                        }
                        zend_hash_update_mem(*overriden, key, fn, sizeof(zend_function));
                        return;