浏览代码

Properly initialize and delete send buffer

Stefan Profanter 7 年之前
父节点
当前提交
e9e2da24c4
共有 1 个文件被更改,包括 2 次插入2 次删除
  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