]> source.dussan.org Git - rspamd.git/commitdiff
Fix couple of issues found by coverity scan
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 11 Feb 2016 11:02:42 +0000 (11:02 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 11 Feb 2016 11:02:42 +0000 (11:02 +0000)
src/libstat/backends/redis_backend.c
src/libutil/http.c
src/libutil/regexp.c
src/rspamadm/configdump.c

index 406b76ab5184494d8586c7ec520551e786278112..61644d0042e4b67f3bfc7b181a35815a6e4e4f92 100644 (file)
@@ -240,7 +240,7 @@ rspamd_redis_expand_object (const gchar *pattern,
                }
        }
 
-       if (target == NULL) {
+       if (target == NULL || task == NULL) {
                return tlen;
        }
 
index 21b763108fb674651eefd016d1e10ad7b1dd3f5e..a5dcf6f0385f436da6a0d2a070bccb50d656bf44 100644 (file)
@@ -431,6 +431,9 @@ rspamd_http_parse_key (rspamd_ftok_t *data, struct rspamd_http_connection *conn,
                                                                        priv->local_key, priv->msg->peer_key);
                                                }
                                        }
+                                       else {
+                                               rspamd_pubkey_unref (pk);
+                                       }
                                }
                        }
 
index 023cc325d13446790e9b628ddd71da9eb76033c3..4cc0125679a79ba28b7307c1a68861ecd44881f5 100644 (file)
@@ -476,7 +476,7 @@ fin:
                res->raw_re = pcre2_compile (real_pattern, PCRE2_ZERO_TERMINATED,
                                        regexp_flags & ~PCRE_FLAG(UTF),
                                        &err_code, &err_off, pcre2_ctx);
-               if (r == NULL) {
+               if (res->raw_re == NULL) {
                        err_str = g_alloca (1024);
                        memset (err_str, 0, 1024);
                        pcre2_get_error_message (err_code, err_str, 1024);
index 64fb9703d82c7a19a1782c4c1a1dd0de9e5d5afd..ca89b5325ebf39a1b4b68a1950fff488d36a8613 100644 (file)
@@ -104,6 +104,7 @@ rspamadm_add_doc_elt (const ucl_object_t *obj, const ucl_object_t *doc_obj,
                nobj = ucl_object_fromstring_common ("/*", 0, 0);
        }
        else {
+               rspamd_fstring_free (comment);
                return;
        }