File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1670,9 +1670,11 @@ static int php_cli_server_client_read_request_on_header_value(php_http_parser *p
1670
1670
client -> current_header_value = zend_string_init (at , length , /* persistent */ true);
1671
1671
break ;
1672
1672
case HEADER_VALUE : {
1673
+ /* Assert that there is only one reference to the header value, as then zend_string_extends()
1674
+ * will reallocate it such that we do not need to release the old value. */
1675
+ ZEND_ASSERT (GC_REFCOUNT (client -> current_header_value ) == 1 );
1673
1676
/* Previous element was part of header value, append content to it */
1674
1677
size_t old_length = ZSTR_LEN (client -> current_header_value );
1675
- // TODO Release old value?
1676
1678
client -> current_header_value = zend_string_extend (client -> current_header_value , old_length + length , /* persistent */ true);
1677
1679
memcpy (ZSTR_VAL (client -> current_header_value ) + old_length , at , length );
1678
1680
// Null terminate
You can’t perform that action at this time.
0 commit comments