summaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-25 12:45:29 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-25 12:45:29 +0100
commitcf071c74aa8e7d2975b08a1271902401890c41f7 (patch)
treec9380a7702d1f1fc4db5012d3a413e30d11aabd6 /src/libserver
parent0d0e9a7046cff4c7681d791a1275f906d4569d40 (diff)
downloadrspamd-cf071c74aa8e7d2975b08a1271902401890c41f7.tar.gz
rspamd-cf071c74aa8e7d2975b08a1271902401890c41f7.zip
[Minor] Fix some more issues
Found by: coverity scan
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/maps/map.c8
-rw-r--r--src/libserver/re_cache.c7
2 files changed, 13 insertions, 2 deletions
diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c
index eaf7958f8..d30b2b40d 100644
--- a/src/libserver/maps/map.c
+++ b/src/libserver/maps/map.c
@@ -2661,6 +2661,14 @@ err:
g_free (hdata);
}
+ if (fdata) {
+ g_free (fdata);
+ }
+
+ if (sdata) {
+ g_free (sdata);
+ }
+
return NULL;
}
diff --git a/src/libserver/re_cache.c b/src/libserver/re_cache.c
index 4d631da01..82bbcee1c 100644
--- a/src/libserver/re_cache.c
+++ b/src/libserver/re_cache.c
@@ -1889,7 +1889,7 @@ rspamd_re_cache_compile_timer_cb (EV_P_ ev_timer *w, int revents )
guint *hs_flags = NULL;
const hs_expr_ext_t **hs_exts = NULL;
gchar **hs_pats = NULL;
- gchar *hs_serialized;
+ gchar *hs_serialized = NULL;
gsize serialized_len;
struct iovec iov[7];
struct rspamd_re_cache *cache;
@@ -1918,7 +1918,7 @@ rspamd_re_cache_compile_timer_cb (EV_P_ ev_timer *w, int revents )
/* Read number of regexps */
g_assert (fd != -1);
- lseek (fd, RSPAMD_HS_MAGIC_LEN + sizeof (cache->plt), SEEK_SET);
+ g_assert (lseek (fd, RSPAMD_HS_MAGIC_LEN + sizeof (cache->plt), SEEK_SET) != -1);
g_assert (read (fd, &n, sizeof (n)) == sizeof (n));
close (fd);
@@ -2212,6 +2212,9 @@ rspamd_re_cache_compile_timer_cb (EV_P_ ev_timer *w, int revents )
(gint)g_hash_table_size (re_class->re),
path);
+ g_free (hs_serialized);
+ g_free (hs_ids);
+ g_free (hs_flags);
unlink (path);
close (fd);
rspamd_re_cache_compile_err (EV_A_ w, err, cbdata);