[php-src] PR #21430: Simplify php_openssl_load_all_certs_from_file()
| From: | botovq | Date: | Fri, 13 Mar 2026 04:03:56 +0000 |
| Subject: | [php-src] PR #21430: Simplify php_openssl_load_all_certs_from_file() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-35189@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/21430
Author: botovq
Correctly free both stacks, sk and stack, in the exit path and transfer ownership of stack to ret on
success. Don't free the members of sk in the loop, only steal the certs after successful
sk_X509_push(), which is error checked as it always should be. Switch from sk_new_reserve() back to
the much saner sk_X509_new_null(). This makes ownership in this code easier to reason about and more
robust to future modifications.
Alternative to #21418