Browse Source

integrating some minor fixes proposed by @tpiat, fixes #418, fixes #408

Stasik0 9 years ago
parent
commit
7139e0ad93
2 changed files with 9 additions and 1 deletions
  1. 8 0
      examples/logger_stdout.h
  2. 1 1
      src/server/ua_server_addressspace.c

+ 8 - 0
examples/logger_stdout.h

@@ -9,7 +9,15 @@
 #include "ua_types.h"
 #include "ua_log.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** Initialises the logger for the current thread. */
 UA_EXPORT UA_Logger Logger_Stdout_new(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* LOGGER_STDOUT_H_ */

+ 1 - 1
src/server/ua_server_addressspace.c

@@ -1596,7 +1596,7 @@ void UA_Server_addInstanceOf_instatiateChildNode(UA_Server *server,
                                                         objectRoot, *objectRootExpanded, ref.referenceTypeId,
                                                         callback, UA_TRUE, instantiatedTypes, handle);
           instantiatedTypes->size = lastArrayDepth;
-          instantiatedTypes->ids = (UA_NodeId *) realloc(instantiatedTypes->ids, lastArrayDepth);
+          instantiatedTypes->ids = (UA_NodeId *) UA_realloc(instantiatedTypes->ids, lastArrayDepth);
           
           UA_Server_deleteNodeCopy(server, (void **) &nodeClone);
           UA_ExpandedNodeId_deleteMembers(objectRootExpanded); // since we only borrowed this, reset it