aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/sqlite_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/sqlite_utils.c')
-rw-r--r--src/libutil/sqlite_utils.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libutil/sqlite_utils.c b/src/libutil/sqlite_utils.c
index 883d26580..452559c76 100644
--- a/src/libutil/sqlite_utils.c
+++ b/src/libutil/sqlite_utils.c
@@ -366,7 +366,9 @@ rspamd_sqlite3_open_or_create (rspamd_mempool_t *pool, const gchar *path, const
sqlite3_close (sqlite);
rspamd_file_unlock (lock_fd, FALSE);
unlink (lock_path);
- close (lock_fd);
+ if (lock_fd != -1) {
+ close (lock_fd);
+ }
return NULL;
}
@@ -391,7 +393,11 @@ rspamd_sqlite3_open_or_create (rspamd_mempool_t *pool, const gchar *path, const
#endif
rspamd_file_unlock (lock_fd, FALSE);
unlink (lock_path);
- close (lock_fd);
+
+ if (lock_fd != -1) {
+ close (lock_fd);
+ }
+
return NULL;
}
}