aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/sqlite_utils.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-22 23:39:49 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-22 23:39:49 +0000
commit4394fa14de48cf7000cd89d87f1b7829616ee7df (patch)
tree859f59cb1982d0cee6d78df48482872d33504d53 /src/libutil/sqlite_utils.c
parent2b0e6f4d0e0582006c172867df93121755201e66 (diff)
downloadrspamd-4394fa14de48cf7000cd89d87f1b7829616ee7df.tar.gz
rspamd-4394fa14de48cf7000cd89d87f1b7829616ee7df.zip
Fix some more issues found by coverity
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;
}
}