diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-22 23:39:49 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-22 23:39:49 +0000 |
commit | 4394fa14de48cf7000cd89d87f1b7829616ee7df (patch) | |
tree | 859f59cb1982d0cee6d78df48482872d33504d53 /src/libutil/sqlite_utils.c | |
parent | 2b0e6f4d0e0582006c172867df93121755201e66 (diff) | |
download | rspamd-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.c | 10 |
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; } } |