Commit 4c04ff3
authored
* uri: Make the `.free_uri` handlers safe to call with `NULL`
The `php_uri_free()` function already unconditionally called `->free_uri()` and
thus couldn't be safely used when the `->uri` was `NULL` for some reason.
The lexbor implementation was already safe, because `lxb_url_destroy()` is
guaranteed to be a noop for `NULL`.
* uri: Stop checking for `NULL` before calling `->free_uri()`
This implicitly fixes an `UNEXPECTED(…->uri != NULL)` in `uri_free_obj_handler`
that likely should have read `EXPECTED` instead.
* uri: Remove unnecessary reset of `->uri` to `NULL` in `php_uri_object_handler_free()`
* uri: Document the requirement of `free_uri()` being safe with `NULL`
1 parent cebe50a commit 4c04ff3
File tree
4 files changed
+12
-11
lines changed- ext/uri
4 files changed
+12
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
830 | 830 | | |
831 | 831 | | |
832 | 832 | | |
833 | | - | |
834 | | - | |
835 | | - | |
| 833 | + | |
836 | 834 | | |
837 | 835 | | |
838 | 836 | | |
| |||
1025 | 1023 | | |
1026 | 1024 | | |
1027 | 1025 | | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
| 1026 | + | |
1034 | 1027 | | |
1035 | 1028 | | |
1036 | 1029 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
161 | 165 | | |
162 | 166 | | |
163 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
| 557 | + | |
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
561 | 565 | | |
562 | 566 | | |
563 | 567 | | |
| |||
0 commit comments