diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-09-18 12:29:57 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-09-18 12:29:57 +0100 |
commit | 4041c2d64024f27488461e03fcd587dfbb34c4b0 (patch) | |
tree | 9af52fdbc4789fc8f35f164a414431ca37710b43 /src/libserver/maps | |
parent | 1589bd19ff7c841203c548de2c5897e0f0f22c6d (diff) | |
download | rspamd-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.c | 2 | ||||
-rw-r--r-- | src/libserver/maps/map_helpers.c | 1 |
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; |