Commit 7754eaf
committed
Fix memory leaks when sk_X509_new_null() fails
In a lot of places the return value is not checked, and when the
function fails the code continues execution. However, this means that
operations on the stack fail and will cause memory leaks on the objects
that weren't pushed.
We also notice an inconsistency in how these failures are handled.
For example, in one place we explicitly have a fatal error
`php_error_docref(NULL, E_ERROR, "Memory allocation failure");`
but this is the only place to do so.
Closes GH-20957.1 parent d9cbc31 commit 7754eaf
2 files changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2552 | 2552 | | |
2553 | 2553 | | |
2554 | 2554 | | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
2555 | 2558 | | |
2556 | 2559 | | |
2557 | 2560 | | |
| |||
5797 | 5800 | | |
5798 | 5801 | | |
5799 | 5802 | | |
| 5803 | + | |
| 5804 | + | |
| 5805 | + | |
5800 | 5806 | | |
5801 | 5807 | | |
5802 | 5808 | | |
| |||
6404 | 6410 | | |
6405 | 6411 | | |
6406 | 6412 | | |
| 6413 | + | |
| 6414 | + | |
| 6415 | + | |
6407 | 6416 | | |
6408 | 6417 | | |
6409 | 6418 | | |
| |||
0 commit comments