Explorar el Código

fix an issue in the write service

Julius Pfrommer hace 6 años
padre
commit
334e25a86d
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/server/ua_services_attribute.c

+ 2 - 1
src/server/ua_services_attribute.c

@@ -783,12 +783,13 @@ writeArrayDimensionsAttribute(UA_Server *server, UA_Session *session,
 
     /* Ok, apply */
     UA_UInt32 *oldArrayDimensions = node->arrayDimensions;
+    size_t oldArrayDimensionsSize = node->arrayDimensionsSize;
     retval = UA_Array_copy(arrayDimensions, arrayDimensionsSize,
                            (void**)&node->arrayDimensions,
                            &UA_TYPES[UA_TYPES_UINT32]);
     if(retval != UA_STATUSCODE_GOOD)
         return retval;
-    UA_free(oldArrayDimensions);
+    UA_Array_delete(oldArrayDimensions, oldArrayDimensionsSize, &UA_TYPES[UA_TYPES_UINT32]);
     node->arrayDimensionsSize = arrayDimensionsSize;
     return UA_STATUSCODE_GOOD;
 }