Browse Source

fix two issues found by clang-analyzer

Julius Pfrommer 9 years ago
parent
commit
7dc2e7212f
2 changed files with 1 additions and 3 deletions
  1. 1 1
      src/server/ua_server_binary.c
  2. 0 2
      src/ua_types.c

+ 1 - 1
src/server/ua_server_binary.c

@@ -320,7 +320,7 @@ processMSG(UA_Connection *connection, UA_Server *server, const UA_ByteString *ms
     UA_StatusCode retval = UA_UInt32_decodeBinary(msg, pos, &secureChannelId);
     UA_StatusCode retval = UA_UInt32_decodeBinary(msg, pos, &secureChannelId);
     retval |= UA_UInt32_decodeBinary(msg, pos, &tokenId);
     retval |= UA_UInt32_decodeBinary(msg, pos, &tokenId);
     retval |= UA_SequenceHeader_decodeBinary(msg, pos, &sequenceHeader);
     retval |= UA_SequenceHeader_decodeBinary(msg, pos, &sequenceHeader);
-    retval = UA_NodeId_decodeBinary(msg, pos, &requestTypeId);
+    retval |= UA_NodeId_decodeBinary(msg, pos, &requestTypeId);
     if(retval != UA_STATUSCODE_GOOD)
     if(retval != UA_STATUSCODE_GOOD)
         return;
         return;
 
 

+ 0 - 2
src/ua_types.c

@@ -526,8 +526,6 @@ UA_StatusCode UA_Variant_setScalarCopy(UA_Variant *v, const void *p, const UA_Da
     void *new = UA_malloc(type->memSize);
     void *new = UA_malloc(type->memSize);
     if(!new)
     if(!new)
         return UA_STATUSCODE_BADOUTOFMEMORY;
         return UA_STATUSCODE_BADOUTOFMEMORY;
-    if(!v)
-        return UA_STATUSCODE_BADINTERNALERROR;
     UA_StatusCode retval = UA_copy(p, new, type);
     UA_StatusCode retval = UA_copy(p, new, type);
 	if(retval != UA_STATUSCODE_GOOD) {
 	if(retval != UA_STATUSCODE_GOOD) {
 		UA_free(new);
 		UA_free(new);