summaryrefslogtreecommitdiffstats
path: root/src/fuzzy_storage.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-15 20:23:35 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-01-15 20:23:35 +0000
commit0e270dbe709e743ec840999c05e35f4d63be69b4 (patch)
tree810753d3258d55c35efc599f279d560accb6fe40 /src/fuzzy_storage.c
parente0446369d13269d07cecb5711fbab7d7bc64398a (diff)
downloadrspamd-0e270dbe709e743ec840999c05e35f4d63be69b4.tar.gz
rspamd-0e270dbe709e743ec840999c05e35f4d63be69b4.zip
[Fix] Fix couple of issues
Found by: Coverity
Diffstat (limited to 'src/fuzzy_storage.c')
-rw-r--r--src/fuzzy_storage.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c
index 3e2c00f74..94dfa906c 100644
--- a/src/fuzzy_storage.c
+++ b/src/fuzzy_storage.c
@@ -1080,7 +1080,7 @@ rspamd_fuzzy_mirror_process_update (struct fuzzy_master_update_session *session,
*/
p = rspamd_http_message_get_body (msg, &remain);
- if (remain > sizeof (gint32) * 2) {
+ if (p && remain > sizeof (gint32) * 2) {
memcpy (&revision, p, sizeof (gint32));
revision = GINT32_TO_LE (revision);
@@ -1322,6 +1322,7 @@ rspamd_fuzzy_mirror_finish_handler (struct rspamd_http_connection *conn,
if (!rspamd_http_message_get_body (msg, NULL) || !msg->url
|| msg->url->len == 0) {
msg_err_fuzzy_update ("empty update message, not processing");
+ err_str = "Empty update";
goto end;
}
@@ -1883,18 +1884,15 @@ fuzzy_storage_parse_mirror (rspamd_mempool_t *pool,
return TRUE;
err:
+ g_free (up->name);
+ rspamd_upstreams_destroy (up->u);
- if (up) {
- g_free (up->name);
- rspamd_upstreams_destroy (up->u);
-
- if (up->key) {
- rspamd_pubkey_unref (up->key);
- }
-
- g_slice_free1 (sizeof (*up), up);
+ if (up->key) {
+ rspamd_pubkey_unref (up->key);
}
+ g_slice_free1 (sizeof (*up), up);
+
return FALSE;
}