Pārlūkot izejas kodu

Properly initialize and delete send buffer

Stefan Profanter 7 gadi atpakaļ
vecāks
revīzija
e9e2da24c4
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      tests/testing_networklayers.c

+ 2 - 2
tests/testing_networklayers.c

@@ -8,14 +8,14 @@
 
 static UA_StatusCode
 dummyGetSendBuffer(UA_Connection *connection, size_t length, UA_ByteString *buf) {
-    buf->data = (UA_Byte*)UA_malloc(length);
+    buf->data = length == 0 ? NULL : (UA_Byte*)UA_malloc(length);
     buf->length = length;
     return UA_STATUSCODE_GOOD;
 }
 
 static void
 dummyReleaseSendBuffer(UA_Connection *connection, UA_ByteString *buf) {
-    UA_ByteString_delete(buf);
+    UA_ByteString_deleteMembers(buf);
 }
 
 static UA_StatusCode