Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit c9461a6

Browse files
Initialize port_impl only when it is needed
Found by UndefinedBehaviorSanitizer. Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
1 parent 264b375 commit c9461a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/nxt_unit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1483,9 +1483,9 @@ nxt_unit_request_check_response_port(nxt_unit_request_info_t *req,
14831483
pthread_mutex_lock(&lib->mutex);
14841484

14851485
port = nxt_unit_port_hash_find(&lib->ports, port_id, 0);
1486-
port_impl = nxt_container_of(port, nxt_unit_port_impl_t, port);
14871486

14881487
if (nxt_fast_path(port != NULL)) {
1488+
port_impl = nxt_container_of(port, nxt_unit_port_impl_t, port);
14891489
req->response_port = port;
14901490

14911491
if (nxt_fast_path(port_impl->ready)) {

0 commit comments

Comments
 (0)