[php-src] PR #24670: Fix GH-24668: zend_set_local_var() leaks the previous CV value

From: Date: Sun, 25 Oct 2026 05:43:26 +0000
Subject: [php-src] PR #24670: Fix GH-24668: zend_set_local_var() leaks the previous CV value
Groups: php.git-pulls 
Request: Send a blank email to git-pulls+get-39849@lists.php.net to get a copy of this message
Pull Request: https://github.com/php/php-src/pull/24670 Author: lazerg When the name matches a compiled variable, zend_set_local_var() overwrote the slot without releasing what was already there, so any refcounted value in that CV leaked. zend_set_local_var_str() and the symbol table path both dtor the old value already, this does the same. There is no in-tree caller of zend_set_local_var(), so I checked it by temporarily switching the $http_response_header write in the http wrapper over to it: two file_get_contents() calls in one function leak 8 blocks on a debug build before this change and none after. Fixes #24668

« previous php.git-pulls (#39849) next »