Sfoglia il codice sorgente

Properly initialize and delete send buffer

Stefan Profanter 6 anni fa
parent
commit
e9e2da24c4
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  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