From 4f374c45d9bdefc410fd5f372ef395688f3c5ca7 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Wed, 31 Jan 2024 15:23:10 +0000 Subject: [PATCH] Initialize port_impl only when it is needed Found by UndefinedBehaviorSanitizer. Reviewed-by: Andrew Clayton --- src/nxt_unit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nxt_unit.c b/src/nxt_unit.c index b6291b2da..1fc9acd8d 100644 --- a/src/nxt_unit.c +++ b/src/nxt_unit.c @@ -1483,9 +1483,9 @@ nxt_unit_request_check_response_port(nxt_unit_request_info_t *req, pthread_mutex_lock(&lib->mutex); port = nxt_unit_port_hash_find(&lib->ports, port_id, 0); - port_impl = nxt_container_of(port, nxt_unit_port_impl_t, port); if (nxt_fast_path(port != NULL)) { + port_impl = nxt_container_of(port, nxt_unit_port_impl_t, port); req->response_port = port; if (nxt_fast_path(port_impl->ready)) {