From 9f685022c71bb44008dcc97a38efb9204fb91835 Mon Sep 17 00:00:00 2001 From: nielsdos <7771979+nielsdos@users.noreply.github.com> Date: Mon, 8 May 2023 20:43:24 +0200 Subject: [PATCH] Remove unnecessary NULL assignments after ecalloc in streams 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 f655faef10cbf..eeb3cdf101c6e 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 33ec6c0990b13..165bd7da3ad98 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);