summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2024-01-31 15:23:10 +0000
committerandrey-zelenkov <xim.andrew@gmail.com>2024-03-11 16:51:35 +0000
commitc9461a6ba849c69b0aad4dd5791c65d582946b8d (patch)
tree1bb107df17dd79dc26b7a4156b6bd3147f41db60 /src
parent264b375506121d3a9268552b4f54c77faf171e6a (diff)
downloadunit-c9461a6ba849c69b0aad4dd5791c65d582946b8d.tar.gz
unit-c9461a6ba849c69b0aad4dd5791c65d582946b8d.tar.bz2
Initialize port_impl only when it is needed
Found by UndefinedBehaviorSanitizer. Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to 'src')
-rw-r--r--src/nxt_unit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nxt_unit.c b/src/nxt_unit.c
index b6291b2d..1fc9acd8 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)) {