Browse Source

fix 2 bugs found by coverity

Julius Pfrommer 10 years ago
parent
commit
987037772a
2 changed files with 4 additions and 1 deletions
  1. 3 0
      src/server/ua_securechannel_manager.c
  2. 1 1
      src/server/ua_services_view.c

+ 3 - 0
src/server/ua_securechannel_manager.c

@@ -55,6 +55,9 @@ UA_StatusCode UA_SecureChannelManager_open(UA_SecureChannelManager           *cm
                                            const UA_OpenSecureChannelRequest *request,
                                            UA_OpenSecureChannelResponse      *response) {
     struct channel_list_entry *entry = UA_alloc(sizeof(struct channel_list_entry));
+    if(!entry)
+        return UA_STATUSCODE_BADOUTOFMEMORY;
+
     UA_SecureChannel_init(&entry->channel);
 
     entry->channel.connection = conn;

+ 1 - 1
src/server/ua_services_view.c

@@ -175,7 +175,7 @@ static void getBrowseResult(UA_NodeStore *ns, const UA_BrowseDescription *browse
     const UA_Node *parentNode;
     if(UA_NodeStore_get(ns, &browseDescription->nodeId, &parentNode) != UA_STATUSCODE_GOOD) {
         browseResult->statusCode = UA_STATUSCODE_BADNODEIDUNKNOWN;
-        if(!returnAll)
+        if(!returnAll && browseDescription->includeSubtypes)
             UA_Array_delete(relevantReferenceTypes, relevantReferenceTypesSize, &UA_[UA_NODEID]);
         return;
     }