]> granicus.if.org Git - php/commitdiff
Fixed memory leak and typo
authorDmitry Stogov <dmitry@php.net>
Thu, 22 Dec 2005 09:31:40 +0000 (09:31 +0000)
committerDmitry Stogov <dmitry@php.net>
Thu, 22 Dec 2005 09:31:40 +0000 (09:31 +0000)
Zend/zend_execute.c

index 3f26ba2d2d49f0a277971036e5c11d47c5c67c6f..dc4f2bd3f65d6c400d4908d65c3bdda1b8cee3a2 100644 (file)
@@ -458,12 +458,13 @@ static inline void make_real_object(zval **object_ptr TSRMLS_DC)
 /* this should modify object only if it's empty */
        if ((*object_ptr)->type == IS_NULL
                || ((*object_ptr)->type == IS_BOOL && (*object_ptr)->value.lval==0)
-               || (((*object_ptr)->type == IS_STRING && (*object_ptr)->type == IS_BINARY) && (*object_ptr)->value.str.len == 0)
+               || (((*object_ptr)->type == IS_STRING || (*object_ptr)->type == IS_BINARY) && (*object_ptr)->value.str.len == 0)
                || ((*object_ptr)->type == IS_UNICODE && (*object_ptr)->value.ustr.len == 0)) {
                if (!PZVAL_IS_REF(*object_ptr)) {
                        SEPARATE_ZVAL(object_ptr);
                }
                zend_error(E_STRICT, "Creating default object from empty value");
+               zval_dtor(*object_ptr);
                object_init(*object_ptr);
        }
 }