diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-10-12 20:33:48 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-10-12 20:33:48 +0100 |
commit | e2e021a18220d7966cd7888db912e98108d717f7 (patch) | |
tree | c6a3139c12026bf7afe4ab8fc8059249a3837a8b /src/libstat | |
parent | b68e6b885974acbbf75b244224ca87b2fcf304fc (diff) | |
download | rspamd-e2e021a18220d7966cd7888db912e98108d717f7.tar.gz rspamd-e2e021a18220d7966cd7888db912e98108d717f7.zip |
[Minor] Fix some minor code quality issue
Found by: coverity scan
Diffstat (limited to 'src/libstat')
-rw-r--r-- | src/libstat/backends/mmaped_file.c | 1 | ||||
-rw-r--r-- | src/libstat/backends/redis_backend.c | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/libstat/backends/mmaped_file.c b/src/libstat/backends/mmaped_file.c index f87e9e6bd..7d67fa053 100644 --- a/src/libstat/backends/mmaped_file.c +++ b/src/libstat/backends/mmaped_file.c @@ -571,6 +571,7 @@ rspamd_mmaped_file_open (rspamd_mempool_t *pool, lock_fd = open (lock, O_WRONLY|O_CREAT|O_EXCL, 00600); if (lock_fd == -1) { + g_free (lock); msg_info_pool ("cannot open file %s, it is locked by another process", filename); return NULL; diff --git a/src/libstat/backends/redis_backend.c b/src/libstat/backends/redis_backend.c index 2fd69f436..fdbb77f78 100644 --- a/src/libstat/backends/redis_backend.c +++ b/src/libstat/backends/redis_backend.c @@ -153,15 +153,17 @@ rspamd_redis_expand_object (const gchar *pattern, gint err_idx; g_assert (ctx != NULL); + g_assert (task != NULL); stcf = ctx->stcf; L = task->cfg->lua_state; + g_assert (L != NULL); if (ctx->enable_users) { if (ctx->cbref_user == -1) { rcpt = rspamd_task_get_principal_recipient (task); } - else if (L) { + else { /* Execute lua function to get userdata */ lua_pushcfunction (L, &rspamd_lua_traceback); err_idx = lua_gettop (L); @@ -269,7 +271,7 @@ rspamd_redis_expand_object (const gchar *pattern, } - if (target == NULL || task == NULL) { + if (target == NULL) { return -1; } |