[php-src] PR #17788: Fix memory leak when encoding check fails
| From: | nielsdos | Date: | Thu, 13 Feb 2025 16:02:17 +0000 |
| Subject: | [php-src] PR #17788: Fix memory leak when encoding check fails | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-30749@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/17788
Author: nielsdos
zlib_create_dictionary_string() allocates memory, so we can leak memory if there's an early
exit before the assignment to the return value. Solve this by moving all validation upwards.
Found with an experimental static analysis tool I'm developing.