aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/maps
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-18 12:29:57 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-18 12:29:57 +0100
commit4041c2d64024f27488461e03fcd587dfbb34c4b0 (patch)
tree9af52fdbc4789fc8f35f164a414431ca37710b43 /src/libserver/maps
parent1589bd19ff7c841203c548de2c5897e0f0f22c6d (diff)
downloadrspamd-4041c2d64024f27488461e03fcd587dfbb34c4b0.tar.gz
rspamd-4041c2d64024f27488461e03fcd587dfbb34c4b0.zip
[Minor] Plug some leaks on error paths
Found by: coverity scan
Diffstat (limited to 'src/libserver/maps')
-rw-r--r--src/libserver/maps/map.c2
-rw-r--r--src/libserver/maps/map_helpers.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c
index f324f9d70..eaf7958f8 100644
--- a/src/libserver/maps/map.c
+++ b/src/libserver/maps/map.c
@@ -596,6 +596,8 @@ read_map_file_chunks (struct rspamd_map *map, struct map_cb_data *cbdata,
if (lseek (fd, off, SEEK_SET) == -1) {
msg_err_map ("can't seek in map to pos %d for buffered reading %s: %s",
(gint)off, fname, strerror (errno));
+ close (fd);
+
return FALSE;
}
diff --git a/src/libserver/maps/map_helpers.c b/src/libserver/maps/map_helpers.c
index f98e4dafc..51bc9710c 100644
--- a/src/libserver/maps/map_helpers.c
+++ b/src/libserver/maps/map_helpers.c
@@ -1868,6 +1868,7 @@ rspamd_cdb_list_read (gchar *chunk,
cdb = g_malloc0 (sizeof (struct cdb));
if (cdb_init (cdb, fd) == -1) {
+ g_free (cdb);
msg_err_map ("cannot init cdb map from %s: %s", chunk, strerror (errno));
return NULL;