|
@@ -99,13 +99,16 @@ HelAckHandshake(UA_Client *client, const UA_String endpointUrl) {
|
|
|
|
|
|
/* Prepare the HEL message and encode at offset 8 */
|
|
|
UA_TcpHelloMessage hello;
|
|
|
- UA_String_copy(&endpointUrl, &hello.endpointUrl); /* must be less than 4096 bytes */
|
|
|
+ /* just reference to avoid copy */
|
|
|
+ hello.endpointUrl = endpointUrl;
|
|
|
memcpy(&hello, &client->config.localConnectionConfig,
|
|
|
sizeof(UA_ConnectionConfig)); /* same struct layout */
|
|
|
|
|
|
UA_Byte *bufPos = &message.data[8]; /* skip the header */
|
|
|
const UA_Byte *bufEnd = &message.data[message.length];
|
|
|
retval = UA_TcpHelloMessage_encodeBinary(&hello, &bufPos, bufEnd);
|
|
|
+ /* avoid deleting reference */
|
|
|
+ hello.endpointUrl = UA_STRING_NULL;
|
|
|
UA_TcpHelloMessage_deleteMembers(&hello);
|
|
|
if(retval != UA_STATUSCODE_GOOD) {
|
|
|
conn->releaseSendBuffer(conn, &message);
|