[php-src] PR #11751: Fix leaking definitions on FFI::cdef()->new()
| From: | iluuu1994 | Date: | Thu, 20 Jul 2023 11:46:13 +0000 |
| Subject: | [php-src] PR #11751: Fix leaking definitions on FFI::cdef()->new() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-23120@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/11751
Author: iluuu1994
Previously, FFI_G(symbols) and FFI_G(tags) were never cleaned up when calling new on an existing
object. However, if cdef() is called without parameters these globals are NULL and might be created
when new() creates new definitions. These would then be discarded without freeing them.
Furthermore, when calling new() on an existing object ffi->symbols and ffi->tags are reused
for the operation. new() might add new definitions, leaking them into the next new() call. I'm
not sure if this is desired behavior.
/cc @kocsismate