summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/registry/reg_db.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/registry/reg_db.c b/source3/registry/reg_db.c
index 25c6557c87..19799292ff 100644
--- a/source3/registry/reg_db.c
+++ b/source3/registry/reg_db.c
@@ -329,6 +329,10 @@ WERROR regdb_open( void )
int regdb_close( void )
{
+ if (tdb_refcount == 0) {
+ return 0;
+ }
+
tdb_refcount--;
DEBUG(10,("regdb_close: decrementing refcount (%d)\n", tdb_refcount));