From acc940645e985ab9f452be9a93622b41186ceecf Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 9 May 2023 19:46:45 +0200 Subject: [PATCH] Remove unnecessary NULL assignments after ecalloc in streams (#11209) ecalloc already zeroes the structure, so writing NULL is not necessary. --- main/streams/streams.c | 1 - main/streams/userspace.c | 1 - 2 files changed, 2 deletions(-) diff --git a/main/streams/streams.c b/main/streams/streams.c index f655faef10c..eeb3cdf101c 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -2315,7 +2315,6 @@ PHPAPI php_stream_context *php_stream_context_alloc(void) php_stream_context *context; context = ecalloc(1, sizeof(php_stream_context)); - context->notifier = NULL; array_init(&context->options); context->res = zend_register_resource(context, php_le_stream_context()); diff --git a/main/streams/userspace.c b/main/streams/userspace.c index 33ec6c0990b..165bd7da3ad 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -469,7 +469,6 @@ PHP_FUNCTION(stream_wrapper_register) uwrap->wrapper.wops = &user_stream_wops; uwrap->wrapper.abstract = uwrap; uwrap->wrapper.is_url = ((flags & PHP_STREAM_IS_URL) != 0); - uwrap->resource = NULL; rsrc = zend_register_resource(uwrap, le_protocols);