Remove unnecessary NULL assignments after ecalloc in streams (#11209)

ecalloc already zeroes the structure, so writing NULL is not necessary.
This commit is contained in:
Niels Dossche 2023-05-09 19:46:45 +02:00 committed by GitHub
parent 173680acd3
commit acc940645e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 2 deletions

View file

@ -2315,7 +2315,6 @@ PHPAPI php_stream_context *php_stream_context_alloc(void)
php_stream_context *context; php_stream_context *context;
context = ecalloc(1, sizeof(php_stream_context)); context = ecalloc(1, sizeof(php_stream_context));
context->notifier = NULL;
array_init(&context->options); array_init(&context->options);
context->res = zend_register_resource(context, php_le_stream_context()); context->res = zend_register_resource(context, php_le_stream_context());

View file

@ -469,7 +469,6 @@ PHP_FUNCTION(stream_wrapper_register)
uwrap->wrapper.wops = &user_stream_wops; uwrap->wrapper.wops = &user_stream_wops;
uwrap->wrapper.abstract = uwrap; uwrap->wrapper.abstract = uwrap;
uwrap->wrapper.is_url = ((flags & PHP_STREAM_IS_URL) != 0); uwrap->wrapper.is_url = ((flags & PHP_STREAM_IS_URL) != 0);
uwrap->resource = NULL;
rsrc = zend_register_resource(uwrap, le_protocols); rsrc = zend_register_resource(uwrap, le_protocols);