From d8fe645db444e54fcc8b2555c08a5021c17ca2d3 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Tue, 4 Aug 2015 00:00:10 +0200 Subject: Fix valgrind errors in phpdbg Revert "We cannot safely assume that all op array will be refcount 0 after execution" This reverts commit b6936adb58288a0606ed847802d9226cddb41e2b. This change turns out to not have been a clever idea and was causing more weirdness than it helped... --- sapi/phpdbg/phpdbg.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index ca86a29fcf..89157562c9 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -213,8 +213,8 @@ static PHP_RSHUTDOWN_FUNCTION(phpdbg) /* {{{ */ zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_METHOD]); zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_COND]); zend_hash_destroy(&PHPDBG_G(bp)[PHPDBG_BREAK_MAP]); - zend_hash_destroy(&PHPDBG_G(seek)); zend_hash_destroy(&PHPDBG_G(file_sources)); + zend_hash_destroy(&PHPDBG_G(seek)); zend_hash_destroy(&PHPDBG_G(registered)); zend_hash_destroy(&PHPDBG_G(watchpoints)); zend_llist_destroy(&PHPDBG_G(watchlist_mem)); @@ -234,12 +234,6 @@ static PHP_RSHUTDOWN_FUNCTION(phpdbg) /* {{{ */ PHPDBG_G(oplog) = NULL; } - if (PHPDBG_G(ops)) { - destroy_op_array(PHPDBG_G(ops)); - efree(PHPDBG_G(ops)); - PHPDBG_G(ops) = NULL; - } - if (PHPDBG_G(oplog_list)) { phpdbg_oplog_list *cur = PHPDBG_G(oplog_list); do { @@ -558,8 +552,8 @@ static PHP_FUNCTION(phpdbg_get_executable) phpdbg_file_source *source = zend_hash_find_ptr(&PHPDBG_G(file_sources), name); if (source) { phpdbg_oplog_fill_executable( - source->op_array, - phpdbg_add_empty_array(Z_ARR_P(return_value), source->op_array->filename), + &source->op_array, + phpdbg_add_empty_array(Z_ARR_P(return_value), source->op_array.filename), by_opcode); } } ZEND_HASH_FOREACH_END(); -- cgit v1.2.1