casual blocks: fixed potential NULL dereference (#7704)

The result of FindWorkerNode() is usually checked against NULL.
pull/7662/head^2
Maxim Korotkov 2025-03-05 16:05:21 +03:00 committed by GitHub
parent 30bf960c5c
commit afcda3feff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -431,6 +431,11 @@ PrepareAndSetTransactionClock(void)
MultiConnection *connection = dlist_container(MultiConnection, transactionNode,
iter.cur);
WorkerNode *workerNode = FindWorkerNode(connection->hostname, connection->port);
if (!workerNode)
{
ereport(WARNING, errmsg("Worker node is missing"));
continue;
}
/* Skip the node if we already in the list */
if (list_member_int(nodeList, workerNode->groupId))