Fix #66942 #66952: openssl_seal(), openssl_open() memory leak#632
Fix #66942 #66952: openssl_seal(), openssl_open() memory leak#632chuanma wants to merge 4 commits intophp:masterfrom
Conversation
|
Hi, it fixes same mem leaks but not all. The |
|
Thanks for the suggesiton. I'll clean up that section of code a bit more to cover all cases. |
|
replace |
|
I see in the tests this: TEST 5193/12224 [ext/openssl/tests/002.phpt] Which is not good. Looks like the patch is not right. |
|
@smalyshev Thanks for pointing that out. I missed one corner case. I'll get a fix soon and pay more attention to the Travis CI build. |
…_seal() because in one corner case the variable ctx has not been initiated yet.
|
Ok. My previous commit fixed that test in [ext/openssl/tests/002.phpt]. Travis CI build failed from other reasons. Because the normal workflow is already tested in [ext/openssl/tests/013.phpt], I don't add a new test case. |
|
Comment on behalf of stas at php.net: merged |
Related to the bug https://bugs.php.net/bug.php?id=66942 I reported a couple of days ago.
A similar memory leak in openssl_encrypt() (https://bugs.php.net/bug.php?id=54060) has been fixed by calling EVP_CIPHER_CTX_cleanup() once. But here we need to call it twice because the variable ctx is reused.
Also fixed the memory leak in openssl_open(). https://bugs.php.net/bug.php?id=66952