Fix potential deadlock (bug #6169)
authorMark Spencer <markster@digium.com>
Sat, 7 Jan 2006 19:30:44 +0000 (19:30 +0000)
committerMark Spencer <markster@digium.com>
Sat, 7 Jan 2006 19:30:44 +0000 (19:30 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7856 65c4cc65-6c06-0410-ace0-fbb531ad65f3

db.c

diff --git a/db.c b/db.c
index d3da08a..8e301c5 100644 (file)
--- a/db.c
+++ b/db.c
@@ -122,8 +122,10 @@ int ast_db_deltree(const char *family, const char *keytree)
        }
        
        ast_mutex_lock(&dblock);
-       if (dbinit()) 
+       if (dbinit()) {
+               ast_mutex_unlock(&dblock);
                return -1;
+       }
        
        memset(&key, 0, sizeof(key));
        memset(&data, 0, sizeof(data));