about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-05-09 13:39:15 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-05-09 13:39:15 +0200
commit689d6b93301a1f3ea9ad7fb8f7dcd3a6e369df07 (patch)
tree43a524222e278dde8ddc5fdc156b0185bad92755 /src
parent22fdc90fe28171e3e7566684f60305a4f2d04dcf (diff)
downloadbox64-689d6b93301a1f3ea9ad7fb8f7dcd3a6e369df07.tar.gz
box64-689d6b93301a1f3ea9ad7fb8f7dcd3a6e369df07.zip
Fixed a potential deadlock on custom memory managment (mostly for Box32)
Diffstat (limited to 'src')
-rw-r--r--src/custommem.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/custommem.c b/src/custommem.c
index 5e240c1d..96511c58 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -1000,8 +1000,10 @@ size_t customGetUsableSize(void* p)
     mutex_lock(&mutex_blocks);
     blocklist_t* l = findBlock(addr);
     if(l) {
-        if(l->type==BTYPE_MAP)
+        if(l->type==BTYPE_MAP) {
+            mutex_unlock(&mutex_blocks);
             return 128;
+        }
         blockmark_t* sub = (void*)(addr-sizeof(blockmark_t));
 
         size_t size = SIZE_BLOCK(sub->next);