]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix descriptors leak in sqlite3 locking code
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 10 Jul 2018 12:46:17 +0000 (13:46 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 10 Jul 2018 12:46:17 +0000 (13:46 +0100)
src/libutil/sqlite_utils.c

index d4c5e9e20f2eefa64831717ace5faaed50c2ab73..b1e33cb64cdfbb1872cf6cd64dbc371c44299866 100644 (file)
@@ -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