diff --git a/src/server/ua_server_utils.c b/src/server/ua_server_utils.c index f70f21efce1..ac0acd5b45a 100644 --- a/src/server/ua_server_utils.c +++ b/src/server/ua_server_utils.c @@ -36,9 +36,6 @@ getNodeType(UA_Server *server, const UA_NodeHead *head) { UA_Boolean inverse; switch(head->nodeClass) { case UA_NODECLASS_OBJECT: - parentRefIndex = UA_REFERENCETYPEINDEX_HASTYPEDEFINITION; - inverse = false; - break; case UA_NODECLASS_VARIABLE: parentRefIndex = UA_REFERENCETYPEINDEX_HASTYPEDEFINITION; inverse = false; diff --git a/src/server/ua_services_nodemanagement.c b/src/server/ua_services_nodemanagement.c index 5a4ca440648..40908b79501 100644 --- a/src/server/ua_services_nodemanagement.c +++ b/src/server/ua_services_nodemanagement.c @@ -375,10 +375,11 @@ typeCheckVariableNode(UA_Server *server, UA_Session *session, } /* Type-check the value */ - if(retval == UA_STATUSCODE_GOOD && - !compatibleValue(server, session, &node->dataType, node->valueRank, - node->arrayDimensionsSize, node->arrayDimensions, - &value.value, NULL, &reason)) { + UA_Boolean compatible = + compatibleValue(server, session, &node->dataType, + node->valueRank, node->arrayDimensionsSize, + node->arrayDimensions, &value.value, NULL, &reason); + if(!compatible) { UA_LOG_NODEID_INFO(&node->head.nodeId, UA_LOG_INFO_SESSION(server->config.logging, session, "AddNode (%.*s): The VariableNode value has " @@ -1587,10 +1588,9 @@ addNode_finish(UA_Server *server, UA_Session *session, const UA_NodeId *nodeId) } cleanup: + UA_NODESTORE_RELEASE(server, node); if(type) UA_NODESTORE_RELEASE(server, type); - if(node) - UA_NODESTORE_RELEASE(server, node); if(retval != UA_STATUSCODE_GOOD) deleteNode(server, *nodeId, true); return retval; diff --git a/src/server/ua_subscription_monitoreditem.c b/src/server/ua_subscription_monitoreditem.c index 95ca6b3dfab..1055e5cc138 100644 --- a/src/server/ua_subscription_monitoreditem.c +++ b/src/server/ua_subscription_monitoreditem.c @@ -276,9 +276,9 @@ UA_Notification_enqueueAndTrigger(UA_Server *server, UA_Notification *n) { mon->triggeredUntil > UA_DateTime_nowMonotonic())) { UA_Notification_enqueueSub(n); mon->triggeredUntil = UA_INT64_MIN; - UA_LOG_DEBUG_SUBSCRIPTION(server->config.logging, mon->subscription, + UA_LOG_DEBUG_SUBSCRIPTION(server->config.logging, sub, "Notification enqueued (Queue size %lu)", - (long unsigned)mon->subscription->notificationQueueSize); + (long unsigned)sub->notificationQueueSize); } /* Insert into the MonitoredItem. This checks the queue size and @@ -430,7 +430,6 @@ UA_Server_registerMonitoredItem(UA_Server *server, UA_MonitoredItem *mon) { UA_Subscription *sub = mon->subscription; if(sub) { mon->monitoredItemId = ++sub->lastMonitoredItemId; - mon->subscription = sub; sub->monitoredItemsSize++; LIST_INSERT_HEAD(&sub->monitoredItems, mon, listEntry); } else {