[php-src] PR #11881: Fix GH-11878: SQLite3 callback functions cause a memory leak with a callable array
| From: | nielsdos | Date: | Sat, 05 Aug 2023 15:48:17 +0000 |
| Subject: | [php-src] PR #11881: Fix GH-11878: SQLite3 callback functions cause a memory leak with a callable array | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-23284@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/11881
Author: nielsdos
In this test file, the free_obj handler is called with a refcount of 2, caused by the fact it
participates in a cycle and we do a GC_ADDREF() to increase its refcount. We never decrease its
refcount so it never becomes 0 causing a memory leak.
This happens in shutdown. Whether it is actually useful to check the refcount afterwards is up for
debate.