com php-src: Fix leak on self-referencing constants: Zend/zend_constants.c

From: Date: Wed, 03 Aug 2016 21:10:09 +0000
Subject: com php-src: Fix leak on self-referencing constants: Zend/zend_constants.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-93595@lists.php.net to get a copy of this message
Commit: ec6d70db770874d11f6d76ce31ed9b28e56049a5 Author: Nikita Popov <nikic@php.net> Wed, 3 Aug 2016 23:09:17 +0200 Parents: b304ab5c70f06fe2d91f76a53bb5e5842473575f Branches: PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ec6d70db770874d11f6d76ce31ed9b28e56049a5 Log: Fix leak on self-referencing constants Changed paths: M Zend/zend_constants.c Diff: diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index 3e09f0c..1759f8d 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -375,12 +375,14 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope, if (Z_TYPE_P(ret_constant) == IS_CONSTANT_AST) { if (IS_CONSTANT_VISITED(ret_constant)) { zend_throw_error(NULL, "Cannot declare self-referencing constant '%s::%s'", ZSTR_VAL(class_name), ZSTR_VAL(constant_name)); + ret_constant = NULL; goto failure; } MARK_CONSTANT_VISITED(ret_constant); } if (UNEXPECTED(zval_update_constant_ex(ret_constant, ce) != SUCCESS)) { RESET_CONSTANT_VISITED(ret_constant); + ret_constant = NULL; goto failure; } RESET_CONSTANT_VISITED(ret_constant);

« previous php.cvs (#93595) next »