Browse Source

Merge pull request #1144 from open62541/hotfix/fuzz_2888

Fix memory leak
Stefan Profanter 7 years ago
parent
commit
e7b6494ada
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/ua_types_encoding_binary.c

+ 3 - 0
src/ua_types_encoding_binary.c

@@ -1487,6 +1487,9 @@ UA_decodeBinaryInternal(void *dst, const UA_DataType *type) {
             ptr += sizeof(void*);
         }
     }
+    if (retval != UA_STATUSCODE_GOOD) {
+        UA_deleteMembers(dst, type);
+    }
     return retval;
 }