Don't copy mime types in CLI server

This is both unnecessary and causes leaks in valgrind.
This commit is contained in:
Nikita Popov 2016-08-09 15:33:15 +02:00
parent 3c5e6b29ce
commit 842e408c67

View File

@ -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;