diff options
| author | Remi Collet <remi@remirepo.net> | 2026-06-26 09:34:58 +0200 |
|---|---|---|
| committer | Remi Collet <remi@php.net> | 2026-06-26 09:34:58 +0200 |
| commit | 4f2744656cad572fe8ebe91cb0dc13b03069e569 (patch) | |
| tree | d2e17fb49c35aafaff39e1bc729709327b8510be | |
| parent | 8ba604b2a97d8433d0b5691f92dc022adf229725 (diff) | |
simplify previous
| -rw-r--r-- | rpminfo.c | 6 | ||||
| -rw-r--r-- | tests/006-rpminfo-errors.phpt | 1 |
2 files changed, 3 insertions, 4 deletions
@@ -233,9 +233,7 @@ PHP_FUNCTION(rpminfo) RETURN_THROWS(); } if (error) { - ZVAL_DEREF(error); - zval_ptr_dtor_nogc(error); - ZVAL_NULL(error); + ZEND_TRY_ASSIGN_REF_NULL(error); } if (php_check_open_basedir(path)) { RETURN_NULL(); @@ -268,7 +266,7 @@ PHP_FUNCTION(rpminfo) } if (e_len) { if (error) { - ZVAL_STRINGL(error, e_msg, e_len); + ZEND_TRY_ASSIGN_REF_STRINGL(error, e_msg, e_len); } else { php_error_docref(NULL, E_WARNING, "%s", e_msg); } diff --git a/tests/006-rpminfo-errors.phpt b/tests/006-rpminfo-errors.phpt index 5d205d7..007ed5c 100644 --- a/tests/006-rpminfo-errors.phpt +++ b/tests/006-rpminfo-errors.phpt @@ -9,6 +9,7 @@ var_dump(rpminfo(__DIR__ . "/missing.rpm")); var_dump(rpminfo(__FILE__)); echo "\n+ PHP Warnings\n"; +$error='xxx'; var_dump(rpminfo(__DIR__ . "/missing.rpm", true, $error), $error); var_dump(rpminfo(__FILE__, false, $error), |
