summaryrefslogtreecommitdiffstats
path: root/core/pool_allocator.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-08-07 13:49:33 +0200
committerGitHub <noreply@github.com>2019-08-07 13:49:33 +0200
commitba541bceca806a53070a4fd54955ac4a63c1633a (patch)
treea03f55aa6d660a7c3659705348842a3e5b208e54 /core/pool_allocator.cpp
parent904e3100aceee7560e24ae1293c5b8a1e6201d55 (diff)
parente0b5b218638df5b7b2998233182a7d8a1118e717 (diff)
downloadredot-engine-ba541bceca806a53070a4fd54955ac4a63c1633a.tar.gz
Merge pull request #31077 from qarmin/coverity_bugs
Change some code proposed by Coverity and Cppcheck
Diffstat (limited to 'core/pool_allocator.cpp')
-rw-r--r--core/pool_allocator.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp
index 9b342ef913..48a30f6702 100644
--- a/core/pool_allocator.cpp
+++ b/core/pool_allocator.cpp
@@ -539,6 +539,10 @@ void PoolAllocator::unlock(ID p_mem) {
return;
mt_lock();
Entry *e = get_entry(p_mem);
+ if (!e) {
+ mt_unlock();
+ ERR_FAIL_COND(!e);
+ }
if (e->lock == 0) {
mt_unlock();
ERR_PRINT("e->lock == 0");