mirror of
https://github.com/php/php-src.git
synced 2024-11-25 19:05:31 +08:00
Don't copy mime types in CLI server
This is both unnecessary and causes leaks in valgrind.
This commit is contained in:
parent
3c5e6b29ce
commit
842e408c67
@ -2149,12 +2149,8 @@ static int php_cli_server_mime_type_ctor(php_cli_server *server, const php_cli_s
|
||||
zend_hash_init(&server->extension_mime_types, 0, NULL, NULL, 1);
|
||||
|
||||
for (pair = mime_type_map; pair->ext; pair++) {
|
||||
size_t ext_len = 0, mime_type_len = 0;
|
||||
|
||||
ext_len = strlen(pair->ext);
|
||||
mime_type_len = strlen(pair->mime_type);
|
||||
|
||||
zend_hash_str_add_mem(&server->extension_mime_types, pair->ext, ext_len, (void*)pair->mime_type, mime_type_len + 1);
|
||||
size_t ext_len = strlen(pair->ext);
|
||||
zend_hash_str_add_ptr(&server->extension_mime_types, pair->ext, ext_len, (void*)pair->mime_type);
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
|
Loading…
Reference in New Issue
Block a user