From 1bab735580f83932407b90c722bd021a49c389e8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 24 Jan 2012 20:02:32 +0100 Subject: [PATCH] dirvec: unlock mutex in dirvec_find() in all branches --- src/dirvec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;