Commit d5a7b5f
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.1 parent 19b3003 commit d5a7b5f
1 file changed
+9
-0
lines changed| 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