Fix MEM_testN not unlocking mutex correctly, unlikely to lead to
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 22 Jan 2010 10:56:50 +0000 (10:56 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 22 Jan 2010 10:56:50 +0000 (10:56 +0000)
problems in practice but might as well fix.

intern/guardedalloc/intern/mallocn.c

index 15236a2..342852c 100644 (file)
@@ -539,8 +539,10 @@ short MEM_testN(void *vmemh) {
        if (membl) membl = MEMNEXT(membl);
 
        while(membl) {
-               if (vmemh == membl+1)
+               if (vmemh == membl+1) {
+                       mem_unlock_thread();
                        return 1;
+               }
 
                if(membl->next)
                        membl= MEMNEXT(membl->next);