]> git.sur5r.net Git - openldap/commitdiff
Fix possible crash in DLL_THREAD_DETACH (explodes in .Net Framework)
authorAlexey Naumov <alexey.naumov@gmail.com>
Sun, 25 May 2014 11:10:21 +0000 (17:10 +0600)
committerHoward Chu <hyc@symas.com>
Sat, 31 May 2014 06:39:44 +0000 (23:39 -0700)
libraries/liblmdb/mdb.c

index f66b7198f9b27b0499d5681dd7b29f91ce538ab8..40e68de91256779995599fa92f6d410df0aaa827 100644 (file)
@@ -3677,7 +3677,9 @@ static void NTAPI mdb_tls_callback(PVOID module, DWORD reason, PVOID ptr)
        case DLL_THREAD_DETACH:
                for (i=0; i<mdb_tls_nkeys; i++) {
                        MDB_reader *r = pthread_getspecific(mdb_tls_keys[i]);
-                       mdb_env_reader_dest(r);
+                       if (r) {
+                               mdb_env_reader_dest(r);
+                       }
                }
                break;
        case DLL_PROCESS_DETACH: break;