aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/sqlite_utils.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-07-10 13:46:17 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-07-10 13:46:17 +0100
commitccefb8665119b448f650e8aa2b0c79b8d657bc1d (patch)
tree5a7f3c381c25dcc010b0b1813590e4dfa5681b50 /src/libutil/sqlite_utils.c
parentff7dc7361fb03972ce8a3d05dc126a5fe263c149 (diff)
downloadrspamd-ccefb8665119b448f650e8aa2b0c79b8d657bc1d.tar.gz
rspamd-ccefb8665119b448f650e8aa2b0c79b8d657bc1d.zip
[Fix] Fix descriptors leak in sqlite3 locking code
Diffstat (limited to 'src/libutil/sqlite_utils.c')
-rw-r--r--src/libutil/sqlite_utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/sqlite_utils.c b/src/libutil/sqlite_utils.c
index d4c5e9e20..b1e33cb64 100644
--- a/src/libutil/sqlite_utils.c
+++ b/src/libutil/sqlite_utils.c
@@ -261,6 +261,8 @@ rspamd_sqlite3_wait (rspamd_mempool_t *pool, const gchar *lock)
}
}
+ close (fd);
+
if (nanosleep (&sleep_ts, NULL) == -1 && errno != EINTR) {
msg_err_pool_check ("cannot sleep open lock file %s: %s", lock,
strerror (errno));
@@ -358,8 +360,6 @@ rspamd_sqlite3_open_or_create (rspamd_mempool_t *pool, const gchar *path, const
has_lock = TRUE;
}
- sqlite3_enable_shared_cache (1);
-
if ((rc = sqlite3_open_v2 (path, &sqlite,
flags, NULL)) != SQLITE_OK) {
#if SQLITE_VERSION_NUMBER >= 3008000