diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-07-23 15:08:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-23 15:08:44 +0200 |
commit | 4c943cca2c6d6cd7a197cb1601a6356e65254837 (patch) | |
tree | 0f906f50ff2013f20a274ea6c746c6574a15e1f2 /core/io | |
parent | c7a427241e7f4dd6ab9ac89f51d3bb9f6632008b (diff) | |
parent | aab8da25ad2c3e6d2df03abbc8e35c1725938c40 (diff) |
Merge pull request #30716 from qarmin/fixed_static_analiser_code
Fix some code found by Coverity Scan and PVS Studio
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/packet_peer.cpp | 5 | ||||
-rw-r--r-- | core/io/resource_format_binary.cpp | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index c77c81f9e2..1e4ea715b3 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -110,10 +110,11 @@ Error PacketPeer::put_var(const Variant &p_packet, bool p_full_objects) { Variant PacketPeer::_bnd_get_var(bool p_allow_objects) { Variant var; - get_var(var, p_allow_objects); + Error err = get_var(var, p_allow_objects); + ERR_FAIL_COND_V(err != OK, Variant()); return var; -}; +} Error PacketPeer::_put_packet(const PoolVector<uint8_t> &p_buffer) { return put_packet_buffer(p_buffer); diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 38bef2768e..146480e5a2 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -718,8 +718,8 @@ Error ResourceInteractiveLoaderBinary::poll() { Resource *r = Object::cast_to<Resource>(obj); if (!r) { error = ERR_FILE_CORRUPT; - memdelete(obj); //bye ERR_EXPLAIN(local_path + ":Resource type in resource field not a resource, type is: " + obj->get_class()); + memdelete(obj); //bye ERR_FAIL_V(ERR_FILE_CORRUPT); } |