Commit 81df150
committed
Simplify php_openssl_load_all_certs_from_file()
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.1 parent 5ccaccd commit 81df150
1 file changed
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
691 | 691 | | |
692 | 692 | | |
693 | 693 | | |
| 694 | + | |
694 | 695 | | |
695 | 696 | | |
696 | 697 | | |
| |||
709 | 710 | | |
710 | 711 | | |
711 | 712 | | |
712 | | - | |
| 713 | + | |
713 | 714 | | |
714 | 715 | | |
715 | 716 | | |
716 | 717 | | |
717 | 718 | | |
718 | | - | |
719 | | - | |
| 719 | + | |
| 720 | + | |
720 | 721 | | |
721 | | - | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
722 | 726 | | |
723 | 727 | | |
724 | | - | |
725 | 728 | | |
726 | 729 | | |
727 | 730 | | |
728 | | - | |
729 | 731 | | |
730 | 732 | | |
731 | 733 | | |
| 734 | + | |
732 | 735 | | |
733 | 736 | | |
734 | | - | |
| 737 | + | |
| 738 | + | |
735 | 739 | | |
736 | 740 | | |
737 | 741 | | |
| |||
0 commit comments