aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dirvec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dirvec.c b/src/dirvec.c
index 55021c16e..acc573e13 100644
--- a/src/dirvec.c
+++ b/src/dirvec.c
@@ -54,8 +54,11 @@ struct directory *dirvec_find(const struct dirvec *dv, const char *path)
db_lock();
for (i = dv->nr; --i >= 0; )
- if (!strcmp(directory_get_name(dv->base[i]), path))
+ if (!strcmp(directory_get_name(dv->base[i]), path)) {
+ db_unlock();
return dv->base[i];
+ }
+
db_unlock();
return NULL;