casual blocks: fixed potential NULL dereference

The result of FindWorkerNode() is usually checked
against NULL.
Signed-off-by: Maksim Korotkov <m.korotkov@postgrespro.ru>
pull/7704/head
Maksim Korotkov 2024-10-13 19:24:19 +03:00
parent f6959715dc
commit 41e3392f30
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))