Forráskód Böngészése

fix an unchecked return value in the nodemgmnt service

Julius Pfrommer 7 éve
szülő
commit
0174ca8160
1 módosított fájl, 8 hozzáadás és 2 törlés
  1. 8 2
      src/server/ua_services_nodemanagement.c

+ 8 - 2
src/server/ua_services_nodemanagement.c

@@ -645,8 +645,14 @@ copyCommonVariableAttributes(UA_Server *server, UA_VariableNode *node,
     value.value.storageType = UA_VARIANT_DATA_NODELETE;
 
     /* Use the default value from the vt if none is defined */
-    if(!value.value.type)
-        readValueAttribute(server, (const UA_VariableNode *)vt, &value);
+    if(!value.value.type) {
+        retval = readValueAttribute(server, (const UA_VariableNode*)vt, &value);
+        UA_LOG_INFO(server->config.logger, UA_LOGCATEGORY_SERVER,
+                    "Could not read the value of the variable type "
+                    "with error code %s", UA_StatusCode_name(retval));
+        if(retval != UA_STATUSCODE_GOOD)
+            return retval;
+    }
 
     /* Write the value to the node */
     retval = writeValueAttribute(server, node, &value, NULL);